@sheepdog/svelte
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -80,3 +80,4 @@ export declare const handlers: { | ||
} | ||
export declare function createTask<TArgs = unknown, TReturn = unknown, TModifier = object>(adapter: TaskAdapter<TReturn, TModifier>, gen_or_fun: (args: TArgs, utils: SheepdogUtils) => Promise<TReturn> | AsyncGenerator<unknown, TReturn, unknown>, options?: TaskOptions): { | ||
export type TaskFunction<TArgs = unknown, TReturn = unknown> = (args: TArgs, utils: SheepdogUtils) => Promise<TReturn> | AsyncGenerator<unknown, TReturn, unknown>; | ||
export declare function createTask<TArgs = unknown, TReturn = unknown, TModifier = object>(adapter: TaskAdapter<TReturn, TModifier>, gen_or_fun: TaskFunction<TArgs, TReturn>, options?: TaskOptions): { | ||
cancelAll(): void; | ||
@@ -83,0 +84,0 @@ perform(...args: undefined extends TArgs ? [] : [TArgs]): Promise<TReturn> & { |
@@ -1,4 +0,4 @@ | ||
import { didCancel, timeout } from './utils'; | ||
import { didCancel, timeout, transform } from './utils'; | ||
import { task, CancelationError } from './task.js'; | ||
export type { Task, SheepdogUtils, TaskInstance } from './task.js'; | ||
export { task, CancelationError, didCancel, timeout }; | ||
export { task, CancelationError, didCancel, timeout, transform }; |
// Reexport your entry components here | ||
import { didCancel, timeout } from './utils'; | ||
import { didCancel, timeout, transform } from './utils'; | ||
import { task, CancelationError } from './task.js'; | ||
export { task, CancelationError, didCancel, timeout }; | ||
export { task, CancelationError, didCancel, timeout, transform }; |
@@ -1,2 +0,2 @@ | ||
import type { HandlerType, HandlersMap, SheepdogUtils, TaskOptions } from './core'; | ||
import type { HandlerType, HandlersMap, SheepdogUtils, TaskOptions, TaskFunction } from './core'; | ||
import { CancelationError } from './core'; | ||
@@ -16,3 +16,3 @@ export type { SheepdogUtils, TaskOptions }; | ||
}; | ||
declare function _task<TArgs = unknown, TReturn = undefined>(gen_or_fun: (args: TArgs, utils: SheepdogUtils) => Promise<TReturn> | AsyncGenerator<unknown, TReturn, unknown>, options?: TaskOptions): { | ||
declare function _task<TArgs = unknown, TReturn = undefined>(gen_or_fun: TaskFunction<TArgs, TReturn>, options?: TaskOptions): { | ||
cancelAll(): void; | ||
@@ -33,11 +33,3 @@ perform(...args: undefined extends TArgs ? [] : [TArgs]): Promise<TReturn> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: undefined | TaskInstance<TReturn>; | ||
lastCanceled: undefined | TaskInstance<TReturn>; | ||
lastErrored: undefined | TaskInstance<TReturn>; | ||
lastRunning: undefined | TaskInstance<TReturn>; | ||
lastSuccessful: undefined | TaskInstance<TReturn>; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
@@ -44,0 +36,0 @@ type HandlersShorthands = { |
@@ -1,83 +0,20 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type SheepdogUtils } from '../../index'; | ||
declare const __propDef: { | ||
props: { | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type DefaultProps = typeof __propDef.props; | ||
export type DefaultEvents = typeof __propDef.events; | ||
export type DefaultSlots = typeof __propDef.slots; | ||
export default class Default extends SvelteComponent<DefaultProps, DefaultEvents, DefaultSlots> { | ||
get default_task(): { | ||
z_$$bindings?: Bindings; | ||
} | ||
declare const Default: $$__sveltets_2_IsomorphicComponent<{ | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
@@ -98,3 +35,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -107,5 +54,18 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get options_task(): { | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, { | ||
default_task: { | ||
cancelAll(): void; | ||
@@ -126,3 +86,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -135,15 +105,16 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get default_instances(): (Promise<unknown> & { | ||
default_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
get options_instances(): (Promise<unknown> & { | ||
}>>; | ||
options_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
} | ||
export {}; | ||
}>>; | ||
}, string>; | ||
type Default = InstanceType<typeof Default>; | ||
export default Default; |
@@ -1,84 +0,21 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type SheepdogUtils } from '../../index'; | ||
declare const __propDef: { | ||
props: { | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type DropProps = typeof __propDef.props; | ||
export type DropEvents = typeof __propDef.events; | ||
export type DropSlots = typeof __propDef.slots; | ||
export default class Drop extends SvelteComponent<DropProps, DropEvents, DropSlots> { | ||
get default_task(): { | ||
z_$$bindings?: Bindings; | ||
} | ||
declare const Drop: $$__sveltets_2_IsomorphicComponent<{ | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
@@ -99,3 +36,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -108,5 +55,18 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get options_task(): { | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, { | ||
default_task: { | ||
cancelAll(): void; | ||
@@ -127,3 +87,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -136,15 +106,16 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get default_instances(): (Promise<unknown> & { | ||
default_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
get options_instances(): (Promise<unknown> & { | ||
}>>; | ||
options_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
} | ||
export {}; | ||
}>>; | ||
}, string>; | ||
type Drop = InstanceType<typeof Drop>; | ||
export default Drop; |
@@ -1,84 +0,21 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type SheepdogUtils } from '../../index'; | ||
declare const __propDef: { | ||
props: { | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type EnqueueProps = typeof __propDef.props; | ||
export type EnqueueEvents = typeof __propDef.events; | ||
export type EnqueueSlots = typeof __propDef.slots; | ||
export default class Enqueue extends SvelteComponent<EnqueueProps, EnqueueEvents, EnqueueSlots> { | ||
get default_task(): { | ||
z_$$bindings?: Bindings; | ||
} | ||
declare const Enqueue: $$__sveltets_2_IsomorphicComponent<{ | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
@@ -99,3 +36,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -108,5 +55,18 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get options_task(): { | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, { | ||
default_task: { | ||
cancelAll(): void; | ||
@@ -127,3 +87,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -136,15 +106,16 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get default_instances(): (Promise<unknown> & { | ||
default_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
get options_instances(): (Promise<unknown> & { | ||
}>>; | ||
options_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
} | ||
export {}; | ||
}>>; | ||
}, string>; | ||
type Enqueue = InstanceType<typeof Enqueue>; | ||
export default Enqueue; |
@@ -1,84 +0,21 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type SheepdogUtils } from '../../task'; | ||
declare const __propDef: { | ||
props: { | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type KeepLatestProps = typeof __propDef.props; | ||
export type KeepLatestEvents = typeof __propDef.events; | ||
export type KeepLatestSlots = typeof __propDef.slots; | ||
export default class KeepLatest extends SvelteComponent<KeepLatestProps, KeepLatestEvents, KeepLatestSlots> { | ||
get default_task(): { | ||
z_$$bindings?: Bindings; | ||
} | ||
declare const KeepLatest: $$__sveltets_2_IsomorphicComponent<{ | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
@@ -99,3 +36,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -108,5 +55,18 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get options_task(): { | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, { | ||
default_task: { | ||
cancelAll(): void; | ||
@@ -127,3 +87,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -136,15 +106,16 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get default_instances(): (Promise<unknown> & { | ||
default_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
get options_instances(): (Promise<unknown> & { | ||
}>>; | ||
options_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
} | ||
export {}; | ||
}>>; | ||
}, string>; | ||
type KeepLatest = InstanceType<typeof KeepLatest>; | ||
export default KeepLatest; |
@@ -1,20 +0,22 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type Task } from '../../../index'; | ||
declare const __propDef: { | ||
props: { | ||
parent: Task<number, any>; | ||
kind: string; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type ChildProps = typeof __propDef.props; | ||
export type ChildEvents = typeof __propDef.events; | ||
export type ChildSlots = typeof __propDef.slots; | ||
export default class Child extends SvelteComponent<ChildProps, ChildEvents, ChildSlots> { | ||
z_$$bindings?: Bindings; | ||
} | ||
export {}; | ||
declare const Child: $$__sveltets_2_IsomorphicComponent<{ | ||
parent: Task<number, any>; | ||
kind: string; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, {}, string>; | ||
type Child = InstanceType<typeof Child>; | ||
export default Child; |
@@ -1,21 +0,23 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type SheepdogUtils } from '../../../index'; | ||
declare const __propDef: { | ||
props: { | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type ParentProps = typeof __propDef.props; | ||
export type ParentEvents = typeof __propDef.events; | ||
export type ParentSlots = typeof __propDef.slots; | ||
export default class Parent extends SvelteComponent<ParentProps, ParentEvents, ParentSlots> { | ||
z_$$bindings?: Bindings; | ||
} | ||
export {}; | ||
declare const Parent: $$__sveltets_2_IsomorphicComponent<{ | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, {}, string>; | ||
type Parent = InstanceType<typeof Parent>; | ||
export default Parent; |
@@ -1,84 +0,21 @@ | ||
import { SvelteComponent } from "svelte"; | ||
import { type SheepdogUtils } from '../../index'; | ||
declare const __propDef: { | ||
props: { | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
isRunning: boolean; | ||
last: import("../../task").TaskInstance<unknown> | undefined; | ||
lastCanceled: import("../../task").TaskInstance<unknown> | undefined; | ||
lastErrored: import("../../task").TaskInstance<unknown> | undefined; | ||
lastRunning: import("../../task").TaskInstance<unknown> | undefined; | ||
lastSuccessful: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}; | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: Props & { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type RestartProps = typeof __propDef.props; | ||
export type RestartEvents = typeof __propDef.events; | ||
export type RestartSlots = typeof __propDef.slots; | ||
export default class Restart extends SvelteComponent<RestartProps, RestartEvents, RestartSlots> { | ||
get default_task(): { | ||
z_$$bindings?: Bindings; | ||
} | ||
declare const Restart: $$__sveltets_2_IsomorphicComponent<{ | ||
fn: (args: number, utils: SheepdogUtils) => Promise<unknown> | AsyncGenerator<unknown, unknown, unknown>; | ||
return_value?: (value: unknown) => void; | ||
argument?: number; | ||
max?: number; | ||
default_task?: { | ||
cancelAll(): void; | ||
@@ -99,3 +36,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task?: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -108,5 +55,18 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get options_task(): { | ||
default_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
options_instances?: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}>>; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, { | ||
default_task: { | ||
cancelAll(): void; | ||
@@ -127,3 +87,13 @@ perform(args_0: number): Promise<unknown> & { | ||
performCount: number; | ||
}>, invalidate?: import("svelte/store").Invalidator<{ | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
options_task: { | ||
cancelAll(): void; | ||
perform(args_0: number): Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
}; | ||
} & { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<{ | ||
isRunning: boolean; | ||
@@ -136,15 +106,16 @@ last: import("../../task").TaskInstance<unknown> | undefined; | ||
performCount: number; | ||
}> | undefined) => import("svelte/store").Unsubscriber; | ||
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber; | ||
}; | ||
get default_instances(): (Promise<unknown> & { | ||
default_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
get options_instances(): (Promise<unknown> & { | ||
}>>; | ||
options_instances: Array<ReturnType<(args_0: number) => Promise<unknown> & { | ||
cancel(): void; | ||
} & import("svelte/store").Readable<import("../../task").TaskInstance<unknown>> & { | ||
get: () => import("../../task").TaskInstance<unknown>; | ||
})[]; | ||
} | ||
export {}; | ||
}>>; | ||
}, string>; | ||
type Restart = InstanceType<typeof Restart>; | ||
export default Restart; |
@@ -1,16 +0,18 @@ | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
props: Record<string, never>; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> { | ||
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & { | ||
$$bindings?: Bindings; | ||
} & Exports; | ||
(internal: unknown, props: { | ||
$$events?: Events; | ||
$$slots?: Slots; | ||
}): Exports & { | ||
$set?: any; | ||
$on?: any; | ||
}; | ||
slots: {}; | ||
exports?: {} | undefined; | ||
bindings?: string | undefined; | ||
}; | ||
export type WrongKindProps = typeof __propDef.props; | ||
export type WrongKindEvents = typeof __propDef.events; | ||
export type WrongKindSlots = typeof __propDef.slots; | ||
export default class WrongKind extends SvelteComponent<WrongKindProps, WrongKindEvents, WrongKindSlots> { | ||
z_$$bindings?: Bindings; | ||
} | ||
export {}; | ||
declare const WrongKind: $$__sveltets_2_IsomorphicComponent<Record<string, never>, { | ||
[evt: string]: CustomEvent<any>; | ||
}, {}, {}, string>; | ||
type WrongKind = InstanceType<typeof WrongKind>; | ||
export default WrongKind; |
import { CancelationError } from './core'; | ||
import type { TaskFunction } from './core'; | ||
/** | ||
* Utility method to know if a `perform` thrown because it was canceled | ||
*/ | ||
export declare const didCancel: (e: Error | CancelationError) => e is CancelationError; | ||
/** | ||
* A Promise that will resolve after {ms} milliseconds | ||
*/ | ||
export declare function timeout(ms: number): Promise<unknown>; | ||
/** | ||
* A function to mark your function to be transformable by the | ||
* async transform vite plugin. It will error out in dev mode | ||
* if you didn't add the plugin. | ||
*/ | ||
export declare function transform<TArgs, TReturn>(fn: TaskFunction<TArgs, TReturn>): TaskFunction<TArgs, TReturn>; |
@@ -0,7 +1,25 @@ | ||
import { DEV } from 'esm-env'; | ||
import { CancelationError } from './core'; | ||
/** | ||
* Utility method to know if a `perform` thrown because it was canceled | ||
*/ | ||
export const didCancel = (e) => { | ||
return e instanceof CancelationError; | ||
}; | ||
/** | ||
* A Promise that will resolve after {ms} milliseconds | ||
*/ | ||
export async function timeout(ms) { | ||
return new Promise((resolve) => setTimeout(resolve, ms)); | ||
} | ||
/** | ||
* A function to mark your function to be transformable by the | ||
* async transform vite plugin. It will error out in dev mode | ||
* if you didn't add the plugin. | ||
*/ | ||
export function transform(fn) { | ||
if (DEV) { | ||
throw new Error('You are using the transform function without the vite plugin. Please add the `asyncTransform` plugin to your `vite.config.ts`'); | ||
} | ||
return fn; | ||
} |
@@ -1,2 +0,2 @@ | ||
export declare function asyncTransform(): { | ||
export declare function asyncTransform(): Promise<{ | ||
name: string; | ||
@@ -7,2 +7,2 @@ transform(this: import("rollup").TransformPluginContext, code: string, id: string): Promise<{ | ||
} | undefined>; | ||
}; | ||
}>; |
@@ -1,5 +0,5 @@ | ||
import { parse } from 'acorn'; | ||
import { print } from 'esrap'; | ||
import { walk } from 'zimmerframe'; | ||
export function asyncTransform() { | ||
export async function asyncTransform() { | ||
const { parse } = await import('acorn'); | ||
const { print } = await import('esrap'); | ||
const { walk } = await import('zimmerframe'); | ||
return { | ||
@@ -14,7 +14,10 @@ name: 'sheepdog-async-transform', | ||
}); | ||
let fn_name; | ||
let task_fn_name; | ||
const transform_fn_names = new Set(); | ||
// let's walk once to find the name (we were using a promise before but that's just messy) | ||
walk(ast, {}, { | ||
ImportDeclaration(node) { | ||
if (node.source.value === '@sheepdog/svelte') { | ||
if (node.source.value === '@sheepdog/svelte' || | ||
node.source.value === '@sheepdog/svelte/task' || | ||
node.source.value === '@sheepdog/svelte/utils') { | ||
const task_fn = node.specifiers.find((specifier) => { | ||
@@ -25,4 +28,12 @@ return (specifier.type === 'ImportSpecifier' && | ||
}); | ||
const transform_fn = node.specifiers.find((specifier) => { | ||
return (specifier.type === 'ImportSpecifier' && | ||
specifier.imported.type === 'Identifier' && | ||
specifier.imported.name === 'transform'); | ||
}); | ||
if (transform_fn && transform_fn.type === 'ImportSpecifier') { | ||
transform_fn_names.add(transform_fn.local.name); | ||
} | ||
if (task_fn && task_fn.type === 'ImportSpecifier') { | ||
fn_name = task_fn.local.name; | ||
task_fn_name = task_fn.local.name; | ||
} | ||
@@ -44,7 +55,10 @@ } | ||
let local_changed = false; | ||
if ((node.callee.type === 'Identifier' && node.callee.name === fn_name) || | ||
let task_arg; | ||
if ((node.callee.type === 'Identifier' && | ||
(node.callee.name === task_fn_name || | ||
transform_fn_names.has(node.callee.name))) || | ||
(node.callee.type === 'MemberExpression' && | ||
node.callee.object.type === 'Identifier' && | ||
node.callee.object.name === fn_name)) { | ||
const task_arg = node.arguments[0]; | ||
node.callee.object.name === task_fn_name)) { | ||
task_arg = node.arguments[0]; | ||
if (task_arg && task_arg.type === 'ArrowFunctionExpression' && task_arg.async) { | ||
@@ -72,2 +86,7 @@ const to_change = task_arg; | ||
} | ||
if (task_arg && | ||
node.callee.type === 'Identifier' && | ||
transform_fn_names.has(node.callee.name)) { | ||
return task_arg; | ||
} | ||
}, | ||
@@ -85,3 +104,4 @@ }); | ||
} | ||
catch { | ||
catch (e) { | ||
console.error(e); | ||
/** in case parsing fails */ | ||
@@ -88,0 +108,0 @@ } |
{ | ||
"name": "@sheepdog/svelte", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"repository": { | ||
@@ -40,2 +40,3 @@ "type": "git", | ||
"acorn": "^8.11.3", | ||
"esm-env": "^1.1.4", | ||
"esrap": "^1.2.2", | ||
@@ -49,3 +50,3 @@ "zimmerframe": "^1.1.2" | ||
"@sveltejs/package": "^2.3.1", | ||
"@sveltejs/vite-plugin-svelte": "^3.1.0", | ||
"@sveltejs/vite-plugin-svelte": "^4.0.0", | ||
"@testing-library/jest-dom": "^6.4.5", | ||
@@ -60,4 +61,4 @@ "@testing-library/svelte": "^5.1.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-playwright": "^1.6.1", | ||
"eslint-plugin-svelte": "2.44.1", | ||
"eslint-plugin-playwright": "^2.0.0", | ||
"eslint-plugin-svelte": "2.46.0", | ||
"execa": "^9.4.0", | ||
@@ -70,3 +71,3 @@ "fixturify-project": "^7.1.2", | ||
"publint": "^0.2.7", | ||
"svelte": "^4.2.17", | ||
"svelte": "^5.0.0", | ||
"svelte-check": "^4.0.0", | ||
@@ -78,4 +79,3 @@ "tslib": "^2.6.2", | ||
"vite": "^5.2.11", | ||
"vitest": "^2.1.2", | ||
"@sheepdog/svelte": "link:." | ||
"vitest": "^2.1.2" | ||
}, | ||
@@ -82,0 +82,0 @@ "peerDependencies": { |
@@ -375,1 +375,7 @@ # @sheepdog/svelte | ||
P.s. If, after you run the script, you'll see a folder with `code.js` and no `transform.js` this means that in that case the transform will not apply. | ||
## License | ||
`@sheepdog/svelte` is developed by and © | ||
[Mainmatter GmbH](http://mainmatter.com) and contributors. It is | ||
released under the [MIT License](LICENSE). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
154831
31
111
0
2936
381
5
+ Addedesm-env@^1.1.4