@neovici/cosmoz-queue 2.9.0 → 2.9.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { nothing } from 'lit-html';
|
|
2
1
|
import type { Dialogable, Resolvable } from '@neovici/cosmoz-form';
|
|
2
|
+
import { nothing } from 'lit-html';
|
|
3
3
|
export declare const actionCount: <T>(items: T[], applicableItems?: T[]) => import("lit-html").TemplateResult<1> | undefined;
|
|
4
|
-
export
|
|
4
|
+
export type SyncOpenFn = <T extends object>(dialog: Dialogable<T>) => void;
|
|
5
|
+
export type AsyncOpenFn = <T extends object>(dialog: Resolvable<Dialogable<T>>) => void;
|
|
6
|
+
export interface ActionOpts<TItem extends object, TOpen extends SyncOpenFn | AsyncOpenFn = AsyncOpenFn> {
|
|
5
7
|
items: TItem[];
|
|
6
|
-
open:
|
|
8
|
+
open: TOpen;
|
|
7
9
|
slot?: string;
|
|
8
10
|
}
|
|
9
11
|
export interface DialogOpts<TItem extends object> {
|
|
10
12
|
items: TItem[];
|
|
11
13
|
title: string;
|
|
12
14
|
}
|
|
13
|
-
export interface Action<TItem extends object, TDialog extends object = object> {
|
|
15
|
+
export interface Action<TItem extends object, TDialog extends object = object, TOpen extends SyncOpenFn | AsyncOpenFn = AsyncOpenFn> {
|
|
14
16
|
title: () => string;
|
|
15
17
|
applicable?: (item: TItem) => boolean;
|
|
16
|
-
button?: (opts: Action<TItem, TDialog> & ActionOpts<TItem>) => unknown;
|
|
17
|
-
dialog: (opts: Omit<Action<TItem, TDialog>, 'title'> & DialogOpts<TItem>) => Dialogable<TDialog> | Promise<Dialogable<TDialog>>;
|
|
18
|
+
button?: (opts: Action<TItem, TDialog, TOpen> & ActionOpts<TItem, TOpen>) => unknown;
|
|
19
|
+
dialog: (opts: Omit<Action<TItem, TDialog, TOpen>, 'title'> & DialogOpts<TItem>) => Dialogable<TDialog> | Promise<Dialogable<TDialog>>;
|
|
18
20
|
}
|
|
19
|
-
export declare const defaultButton: <TItem extends object, TDialog extends object = object>(opts: Action<TItem, TDialog> & ActionOpts<TItem>) => import("lit-html").TemplateResult<1> | typeof nothing;
|
|
20
|
-
export declare const action: <TItem extends object, TAction extends object>(action: Action<TItem, TAction>) => Action<TItem, TAction>;
|
|
21
|
-
export declare const renderActions: <TItem extends object, TDialog extends object = object>(opts: ActionOpts<TItem>) => (actions: Action<TItem, TDialog>[]) => unknown[];
|
|
21
|
+
export declare const defaultButton: <TItem extends object, TDialog extends object = object, TOpen extends SyncOpenFn | AsyncOpenFn = AsyncOpenFn>(opts: Action<TItem, TDialog, TOpen> & ActionOpts<TItem, TOpen>) => import("lit-html").TemplateResult<1> | typeof nothing;
|
|
22
|
+
export declare const action: <TItem extends object, TAction extends object>(action: Action<TItem, TAction>) => Action<TItem, TAction, AsyncOpenFn>;
|
|
23
|
+
export declare const renderActions: <TItem extends object, TDialog extends object = object, TOpen extends SyncOpenFn | AsyncOpenFn = AsyncOpenFn>(opts: ActionOpts<TItem, TOpen>) => (actions: Action<TItem, TDialog, TOpen>[]) => unknown[];
|
|
22
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAQ,OAAO,EAAE,MAAM,UAAU,CAAC;AAIzC,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,kBAAiB,CAAC,EAAU,qDAOrE,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE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