@stacksjs/browser 0.75.80 → 0.75.82

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.
@@ -10,5 +10,10 @@ export declare function getBrowserAutoImports(): Record<string, unknown>;
10
10
  * This runs automatically when the module is imported
11
11
  */
12
12
  declare function autoInit(): void;
13
+ /**
14
+ * Flag to prevent double initialization
15
+ * @defaultValue false
16
+ */
17
+ declare let isInitialized: boolean;
13
18
  // Export for manual re-initialization if needed
14
19
  export { autoInit, isInitialized };
@@ -4,6 +4,10 @@ declare function patch(url: string, params?: Params, headers?: Headers): Promise
4
4
  declare function put(url: string, params?: Params, headers?: Headers): Promise<FetchResponse>;
5
5
  declare function destroy(url: string, params?: Params, headers?: Headers): Promise<FetchResponse>;
6
6
  declare function setToken(authToken: string): void;
7
+ /** @defaultValue false */
8
+ declare let loading: boolean;
9
+ /** @defaultValue '' */
10
+ declare let token: string;
7
11
  declare const baseURL: '/';
8
12
  export declare const Fetch: ApiFetch;
9
13
  declare interface Params {
@@ -20,7 +20,12 @@ export declare function createSingletonPromise<T>(fn: () => Promise<T>): Singlet
20
20
  * await lock.wait() // it will wait all tasking finished
21
21
  * ```
22
22
  */
23
- export declare function createPromiseLock(): void;
23
+ export declare function createPromiseLock(): {
24
+ run: <T = void>(fn: () => Promise<T>) => Promise<T>;
25
+ wait: () => Promise<void>;
26
+ isWaiting: () => boolean;
27
+ clear: () => void
28
+ };
24
29
  /**
25
30
  * Return a Promise with `resolve` and `reject` methods
26
31
  *
@@ -1,4 +1,4 @@
1
- declare function customRandom(alphabet: string, defaultSize: number, getRandom: (bytes: number) => Uint8Array): void;
1
+ declare function customRandom(alphabet: string, defaultSize: number, getRandom: (bytes: number) => Uint8Array): (size?: number) => string;
2
2
  declare function customAlphabet(alphabet: string, size?: number): (size?: number) => string;
3
3
  declare function randomNonSecure(size?: number): string;
4
4
  declare function random(size?: number): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/browser",
3
3
  "type": "module",
4
- "version": "0.75.80",
4
+ "version": "0.75.82",
5
5
  "description": "Stacks core frontend/browser functionalities.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -74,9 +74,9 @@
74
74
  "prepublishOnly": "bun run build"
75
75
  },
76
76
  "dependencies": {
77
- "@stacksjs/composables": "0.75.80",
78
- "@stacksjs/datetime": "0.75.80",
79
- "@stacksjs/strings": "0.75.80",
77
+ "@stacksjs/composables": "0.75.82",
78
+ "@stacksjs/datetime": "0.75.82",
79
+ "@stacksjs/strings": "0.75.82",
80
80
  "@stacksjs/stx": "^0.2.378",
81
81
  "bun-query-builder": "^0.3.5"
82
82
  },
@@ -89,7 +89,7 @@
89
89
  }
90
90
  },
91
91
  "devDependencies": {
92
- "@stacksjs/utils": "0.75.80",
92
+ "@stacksjs/utils": "0.75.82",
93
93
  "@stripe/stripe-js": "^10.0.0",
94
94
  "better-dx": "^0.2.24"
95
95
  }