@autoafleveren/ui 1.8.3 → 1.9.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/icons.cjs +1 -1
- package/dist/icons.js +146 -146
- package/dist/types/composables/useEcho/index.d.ts +15 -16
- package/dist/ui.cjs +21 -21
- package/dist/ui.js +348 -337
- package/package.json +1 -1
- package/src/modules/components/AppDataTable/AppDataTable.vue +8 -6
- package/src/modules/composables/useEcho/index.ts +108 -62
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Echo from 'laravel-echo';
|
|
2
2
|
import type { Authorizer, Channel } from 'pusher-js';
|
|
3
|
+
type EventHandler<T = any> = (data: T) => unknown;
|
|
4
|
+
type WrappedEventHandler<T = any> = (data: T) => Promise<void>;
|
|
3
5
|
interface Listener {
|
|
4
6
|
name: string;
|
|
5
7
|
isListening: boolean;
|
|
@@ -9,12 +11,13 @@ interface Caster {
|
|
|
9
11
|
joining: (callback: CallableFunction) => this;
|
|
10
12
|
whisper: (eventName: string, data: Record<any, any>) => this;
|
|
11
13
|
leaving: (callback: CallableFunction) => this;
|
|
14
|
+
listenForWhisper?: (event: string, callback: CallableFunction) => void;
|
|
12
15
|
}
|
|
13
|
-
export declare function getOrCreateListener(
|
|
16
|
+
export declare function getOrCreateListener(listenerName?: string): Listener;
|
|
14
17
|
export declare function registerEcho(key: string, authorizer: (channel: Channel) => Authorizer): void;
|
|
15
18
|
export declare function useEcho(listenerName?: string | null): {
|
|
16
|
-
on: (channel: string, event: string, handler:
|
|
17
|
-
off: (channel: string, event: string) => void;
|
|
19
|
+
on: (channel: string, event: string, handler: EventHandler, privateChannel?: boolean, _unique?: boolean) => void;
|
|
20
|
+
off: (channel: string, event: string, handler?: EventHandler) => void;
|
|
18
21
|
join: (channel: string) => Caster;
|
|
19
22
|
leave: (channel: string) => void;
|
|
20
23
|
whisper: <T = unknown>(event: string, data: T, channel?: string) => void;
|
|
@@ -29,20 +32,16 @@ export declare function useEcho(listenerName?: string | null): {
|
|
|
29
32
|
isListening: boolean;
|
|
30
33
|
}[]>;
|
|
31
34
|
echo: Echo<"pusher"> | null;
|
|
32
|
-
key: string | null;
|
|
33
|
-
authorizer: ((channel: Channel) => Authorizer) | null;
|
|
34
35
|
emitter: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
|
|
35
|
-
casters:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
leaving: (callback: CallableFunction) => Caster;
|
|
45
|
-
}[]>;
|
|
36
|
+
casters: Record<string, Caster>;
|
|
37
|
+
/**
|
|
38
|
+
* Tracks which Echo listeners are already registered.
|
|
39
|
+
*/
|
|
40
|
+
subscriptions: Set<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Maps original handler -> wrapped handler.
|
|
43
|
+
*/
|
|
44
|
+
wrappedHandlers: WeakMap<EventHandler<any>, WrappedEventHandler<any>>;
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
47
|
export {};
|