@craft-native/vue 0.0.92 → 0.0.95

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.
@@ -0,0 +1,10 @@
1
+ export declare function useDatabase(dbPath: string): {
2
+ execute: (sql: string, params?: any[]) => Promise<any>;
3
+ query: <T = any>(sql: string, params?: any[]) => Promise<T[]>;
4
+ transaction: (callback: (tx: {
5
+ execute: (sql: string, params?: any[]) => Promise<any>;
6
+ }) => Promise<void>) => Promise<void>;
7
+ loading: import("vue").Ref<boolean, boolean>;
8
+ error: import("vue").Ref<Error | null, Error | null>;
9
+ };
10
+ //# sourceMappingURL=useDatabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDatabase.d.ts","sourceRoot":"","sources":["../../src/composables/useDatabase.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM;mBAKZ,MAAM,WAAU,GAAG,EAAE;YAiB5B,CAAC,aAAa,MAAM,WAAU,GAAG,EAAE,KAAQ,OAAO,CAAC,CAAC,EAAE,CAAC;4BAiBvC,CAAC,EAAE,EAAE;QAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;EAmCvH"}
@@ -0,0 +1,12 @@
1
+ export declare function useFileSystem(): {
2
+ readFile: (path: string, encoding?: 'utf8' | 'binary') => Promise<any>;
3
+ writeFile: (path: string, data: string | Uint8Array, encoding?: 'utf8' | 'binary') => Promise<void>;
4
+ readDir: (path: string) => Promise<any>;
5
+ mkdir: (path: string, recursive?: boolean) => Promise<void>;
6
+ remove: (path: string, recursive?: boolean) => Promise<void>;
7
+ exists: (path: string) => Promise<any>;
8
+ stat: (path: string) => Promise<any>;
9
+ loading: import("vue").Ref<boolean, boolean>;
10
+ error: import("vue").Ref<Error | null, Error | null>;
11
+ };
12
+ //# sourceMappingURL=useFileSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFileSystem.d.ts","sourceRoot":"","sources":["../../src/composables/useFileSystem.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa;qBAKG,MAAM,aAAY,MAAM,GAAG,QAAQ;sBAiBlC,MAAM,QAAQ,MAAM,GAAG,UAAU,aAAY,MAAM,GAAG,QAAQ;oBAgBhE,MAAM;kBAiBR,MAAM;mBAgBL,MAAM;mBAgBN,MAAM;iBAYR,MAAM;;;EA4BjC"}
@@ -0,0 +1,18 @@
1
+ interface HttpOptions {
2
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
3
+ headers?: Record<string, string>;
4
+ body?: any;
5
+ timeout?: number;
6
+ }
7
+ interface DownloadOptions {
8
+ onProgress?: (progress: number) => void;
9
+ }
10
+ export declare function useHttp(): {
11
+ fetch: <T = any>(url: string, options?: HttpOptions) => Promise<T>;
12
+ download: (url: string, path: string, options?: DownloadOptions) => Promise<void>;
13
+ upload: (url: string, filePath: string, options?: HttpOptions & DownloadOptions) => Promise<any>;
14
+ loading: import("vue").Ref<boolean, boolean>;
15
+ error: import("vue").Ref<Error | null, Error | null>;
16
+ };
17
+ export {};
18
+ //# sourceMappingURL=useHttp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHttp.d.ts","sourceRoot":"","sources":["../../src/composables/useHttp.ts"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,OAAO;YAKA,CAAC,aAAa,MAAM,YAAW,WAAW,KAAQ,OAAO,CAAC,CAAC,CAAC;oBAiBpD,MAAM,QAAQ,MAAM,YAAW,eAAe;kBAwBhD,MAAM,YAAY,MAAM,YAAW,WAAW,GAAG,eAAe;;;EAgC5F"}
@@ -0,0 +1,17 @@
1
+ interface NotificationOptions {
2
+ title: string;
3
+ body?: string;
4
+ icon?: string;
5
+ silent?: boolean;
6
+ tag?: string;
7
+ actions?: Array<{
8
+ action: string;
9
+ title: string;
10
+ }>;
11
+ }
12
+ export declare function useNotification(): {
13
+ send: (options: NotificationOptions) => Promise<void>;
14
+ requestPermission: () => Promise<boolean>;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=useNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotification.d.ts","sourceRoot":"","sources":["../../src/composables/useNotification.ts"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,wBAAgB,eAAe;oBAGA,mBAAmB;;EAejD"}
@@ -0,0 +1,19 @@
1
+ interface TrayMenuItem {
2
+ label: string;
3
+ id: string;
4
+ enabled?: boolean;
5
+ checked?: boolean;
6
+ type?: 'normal' | 'separator' | 'checkbox';
7
+ submenu?: TrayMenuItem[];
8
+ }
9
+ export declare function useTray(): {
10
+ isVisible: import("vue").Ref<boolean, boolean>;
11
+ create: (icon?: string, tooltip?: string) => Promise<void>;
12
+ destroy: () => Promise<void>;
13
+ setIcon: (icon: string) => Promise<void>;
14
+ setTooltip: (tooltip: string) => Promise<void>;
15
+ setMenu: (menu: TrayMenuItem[]) => Promise<void>;
16
+ setTitle: (title: string) => Promise<void>;
17
+ };
18
+ export {};
19
+ //# sourceMappingURL=useTray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTray.d.ts","sourceRoot":"","sources":["../../src/composables/useTray.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;IAC3C,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,wBAAgB,OAAO;;oBAIQ,MAAM,YAAY,MAAM;;oBAYxB,MAAM;0BAKA,MAAM;oBAKZ,YAAY,EAAE;sBAKZ,MAAM;EActC"}
@@ -0,0 +1,16 @@
1
+ export declare function useWindow(): {
2
+ isFullscreen: import("vue").Ref<boolean, boolean>;
3
+ isMaximized: import("vue").Ref<boolean, boolean>;
4
+ isMinimized: import("vue").Ref<boolean, boolean>;
5
+ setTitle: (title: string) => Promise<void>;
6
+ setSize: (width: number, height: number) => Promise<void>;
7
+ setPosition: (x: number, y: number) => Promise<void>;
8
+ maximize: () => Promise<void>;
9
+ minimize: () => Promise<void>;
10
+ restore: () => Promise<void>;
11
+ toggleFullscreen: () => Promise<void>;
12
+ close: () => Promise<void>;
13
+ center: () => Promise<void>;
14
+ setAlwaysOnTop: (alwaysOnTop: boolean) => Promise<void>;
15
+ };
16
+ //# sourceMappingURL=useWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWindow.d.ts","sourceRoot":"","sources":["../../src/composables/useWindow.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS;;;;sBAMQ,MAAM;qBAKP,MAAM,UAAU,MAAM;qBAKtB,MAAM,KAAK,MAAM;;;;;;;kCAwCJ,OAAO;EAoBnD"}
@@ -0,0 +1,159 @@
1
+ interface CraftAPI {
2
+ getPlatform(): Promise<{
3
+ platform: string;
4
+ version: string;
5
+ }>;
6
+ getDeviceInfo(): Promise<{
7
+ platform: string;
8
+ model: string;
9
+ os_version: string;
10
+ }>;
11
+ showToast(message: string, duration: 'short' | 'long'): Promise<void>;
12
+ haptic(type: string): Promise<void>;
13
+ requestPermission(permission: string): Promise<{
14
+ granted: boolean;
15
+ message: string;
16
+ }>;
17
+ on(event: string, callback: (...args: any[]) => void): void;
18
+ off(event: string, callback: (...args: any[]) => void): void;
19
+ emit(event: string, data?: any): void;
20
+ invoke(method: string, params?: any): Promise<any>;
21
+ }
22
+ declare global {
23
+ interface Window {
24
+ craft?: CraftAPI;
25
+ }
26
+ }
27
+ /**
28
+ * Composable to access the Craft API
29
+ */
30
+ export declare function useCraft(): {
31
+ craft: import("vue").Ref<{
32
+ getPlatform: () => Promise<{
33
+ platform: string;
34
+ version: string;
35
+ }>;
36
+ getDeviceInfo: () => Promise<{
37
+ platform: string;
38
+ model: string;
39
+ os_version: string;
40
+ }>;
41
+ showToast: (message: string, duration: 'short' | 'long') => Promise<void>;
42
+ haptic: (type: string) => Promise<void>;
43
+ requestPermission: (permission: string) => Promise<{
44
+ granted: boolean;
45
+ message: string;
46
+ }>;
47
+ on: (event: string, callback: (...args: any[]) => void) => void;
48
+ off: (event: string, callback: (...args: any[]) => void) => void;
49
+ emit: (event: string, data?: any) => void;
50
+ invoke: (method: string, params?: any) => Promise<any>;
51
+ } | null, CraftAPI | {
52
+ getPlatform: () => Promise<{
53
+ platform: string;
54
+ version: string;
55
+ }>;
56
+ getDeviceInfo: () => Promise<{
57
+ platform: string;
58
+ model: string;
59
+ os_version: string;
60
+ }>;
61
+ showToast: (message: string, duration: 'short' | 'long') => Promise<void>;
62
+ haptic: (type: string) => Promise<void>;
63
+ requestPermission: (permission: string) => Promise<{
64
+ granted: boolean;
65
+ message: string;
66
+ }>;
67
+ on: (event: string, callback: (...args: any[]) => void) => void;
68
+ off: (event: string, callback: (...args: any[]) => void) => void;
69
+ emit: (event: string, data?: any) => void;
70
+ invoke: (method: string, params?: any) => Promise<any>;
71
+ } | null>;
72
+ isReady: import("vue").Ref<boolean, boolean>;
73
+ };
74
+ /**
75
+ * Composable to get platform information
76
+ */
77
+ export declare function usePlatform(): {
78
+ platform: import("vue").Ref<{
79
+ platform: string;
80
+ version: string;
81
+ } | null, {
82
+ platform: string;
83
+ version: string;
84
+ } | {
85
+ platform: string;
86
+ version: string;
87
+ } | null>;
88
+ loading: import("vue").Ref<boolean, boolean>;
89
+ error: import("vue").Ref<Error | null, Error | null>;
90
+ };
91
+ /**
92
+ * Composable to get device information
93
+ */
94
+ export declare function useDeviceInfo(): {
95
+ deviceInfo: import("vue").Ref<{
96
+ platform: string;
97
+ model: string;
98
+ os_version: string;
99
+ } | null, {
100
+ platform: string;
101
+ model: string;
102
+ os_version: string;
103
+ } | {
104
+ platform: string;
105
+ model: string;
106
+ os_version: string;
107
+ } | null>;
108
+ loading: import("vue").Ref<boolean, boolean>;
109
+ error: import("vue").Ref<Error | null, Error | null>;
110
+ };
111
+ /**
112
+ * Composable to show toast notifications
113
+ */
114
+ export declare function useToast(): {
115
+ showToast: (message: string, duration?: 'short' | 'long') => Promise<void>;
116
+ };
117
+ /**
118
+ * Composable to trigger haptic feedback
119
+ */
120
+ export declare function useHaptic(): {
121
+ haptic: (type?: string) => Promise<void>;
122
+ };
123
+ /**
124
+ * Composable to request permissions
125
+ */
126
+ export declare function usePermission(permission: string): {
127
+ granted: import("vue").Ref<boolean | null, boolean | null>;
128
+ request: () => Promise<void>;
129
+ loading: import("vue").Ref<boolean, boolean>;
130
+ error: import("vue").Ref<Error | null, Error | null>;
131
+ };
132
+ /**
133
+ * Composable to listen to Craft events
134
+ */
135
+ export declare function useCraftEvent(event: string, callback: (...args: any[]) => void): {
136
+ unsubscribe: () => void;
137
+ };
138
+ /**
139
+ * Composable to invoke Craft methods
140
+ */
141
+ export declare function useCraftInvoke(): {
142
+ invoke: (method: string, params?: any) => Promise<any>;
143
+ isReady: import("vue").Ref<boolean, boolean>;
144
+ };
145
+ /**
146
+ * Composable to check if running on mobile
147
+ */
148
+ export declare function useIsMobile(): import("vue").ComputedRef<boolean>;
149
+ /**
150
+ * Composable to check if running on desktop
151
+ */
152
+ export declare function useIsDesktop(): import("vue").ComputedRef<boolean>;
153
+ export * from './composables/useWindow';
154
+ export * from './composables/useTray';
155
+ export * from './composables/useNotification';
156
+ export * from './composables/useFileSystem';
157
+ export * from './composables/useDatabase';
158
+ export * from './composables/useHttp';
159
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,UAAU,QAAQ;IAChB,WAAW,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,aAAa,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClF,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtF,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;I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