@overlastic/svelte 0.8.0 → 0.8.3

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/index.d.ts CHANGED
@@ -1,21 +1,13 @@
1
1
  import * as _overlastic_core from '@overlastic/core';
2
2
  import { Deferred } from '@overlastic/core';
3
- import { ComponentConstructorOptions } from 'svelte';
4
- import { SvelteComponentTyped } from 'svelte/internal';
5
3
 
6
- interface SMountOptions {
7
- /** current app context */
8
- context?: Map<any, any>;
9
- }
10
-
11
- declare const defineOverlay: <Props, Resolved = void>(instance: any, options?: _overlastic_core.MountOptions<SMountOptions> | undefined) => _overlastic_core.ImperativeOverlay<Props, Resolved, SMountOptions>;
12
- declare const renderOverlay: <Props, Resolved = void>(instance: any, props?: Props | undefined, options?: _overlastic_core.MountOptions<SMountOptions> | undefined) => Promise<Resolved>;
4
+ declare const Overlay: any;
13
5
 
14
- interface ExtendOverlayReturn {
15
- /** the notification reject, modify visible, and destroy it after the duration ends */
16
- reject: (reason?: any) => void;
6
+ interface UseDisclosureReturn {
7
+ /** the notification cancel, modify visible, and destroy it after the duration ends */
8
+ cancel: (reason?: any) => void;
17
9
  /** the notification resolve, modify visible, and destroy it after the duration ends */
18
- resolve: (value?: any) => void;
10
+ confirm: (value?: any) => void;
19
11
  /** destroy the current instance (immediately) */
20
12
  vanish: () => void;
21
13
  /** visible control popup display and hide */
@@ -23,18 +15,20 @@ interface ExtendOverlayReturn {
23
15
  deferred?: Deferred<any>;
24
16
  }
25
17
 
26
- interface ExtendOverlayOptions {
18
+ interface UseDisclosureOptions {
27
19
  /** animation duration to avoid premature destruction of components */
28
20
  duration?: number;
29
21
  /** whether to set visible to true immediately */
30
22
  immediate?: boolean;
31
23
  }
32
- declare function useExtendOverlay(options?: ExtendOverlayOptions): ExtendOverlayReturn;
24
+ declare function useDisclosure(options?: UseDisclosureOptions): UseDisclosureReturn;
33
25
 
34
- declare class Overlay extends SvelteComponentTyped<{
35
- visible?: boolean;
36
- }> {
37
- constructor(options: ComponentConstructorOptions);
26
+ interface SMountOptions {
27
+ /** current app context */
28
+ context?: Map<any, any>;
38
29
  }
39
30
 
40
- export { type ExtendOverlayOptions, type ExtendOverlayReturn, Overlay, defineOverlay, renderOverlay, useExtendOverlay };
31
+ declare const defineOverlay: <Props, Resolved = void>(instance: any, options?: _overlastic_core.MountOptions<SMountOptions> | undefined) => _overlastic_core.ImperativeOverlay<Props, Resolved, SMountOptions>;
32
+ declare const renderOverlay: <Props, Resolved = void>(instance: any, props?: Props | undefined, options?: _overlastic_core.MountOptions<SMountOptions> | undefined) => Promise<Resolved>;
33
+
34
+ export { Overlay, type UseDisclosureOptions, type UseDisclosureReturn, defineOverlay, renderOverlay, useDisclosure };