@sheetxl/sdk 0.8.0-beta.3 → 0.8.0-beta.5
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/browser/cjs/{B0AS8k-hrSCBUlUY.cjs → BV3LBQXG3kA013a2.cjs} +1 -1
- package/browser/cjs/{B44p8LIyxG3GtaGC.cjs → By2s44r4eRFvMq6H.cjs} +43 -43
- package/browser/cjs/{D6YaqporVrSewZpm.cjs → CvjJnxfMX3aal6Zj.cjs} +1 -1
- package/browser/cjs/{B308aXzcAYr1GN1c.cjs → D_hl_D3IBlVqjbUu.cjs} +1 -1
- package/browser/cjs/Nt1C8528otcBXJ2J.cjs +1 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{-OKDZ9cUBtkgD4Zr.mjs → B45qhpdlbHHa6-gu.mjs} +2 -2
- package/browser/esm/{BmEEyMxNzlbXG98H.mjs → B6t-k7D3HcTIJ-Xl.mjs} +2 -2
- package/browser/esm/{DvFKKE72ZA02l8iF.mjs → BiUnakUlo61EtntE.mjs} +1 -1
- package/browser/esm/{8Nw0lKc4ISs7hEJT.mjs → CLfbadk6S57dy8sc.mjs} +4999 -4942
- package/browser/esm/{BtdDRkWn-zCV3oic.mjs → CoiupvxiR8tLrCa4.mjs} +2 -2
- package/browser/esm/{DaCTT4vda0m8Fnxo.mjs → DWJJtu3q6iMfUbbN.mjs} +2 -2
- package/browser/esm/{Z-dzbKvqaxll9l_t.mjs → ahTq_KBqu4jWkQ8A.mjs} +2 -2
- package/browser/esm/index.mjs +7 -7
- package/node/esm/{D5quDVovf1zjYBgJ.mjs → B2dQyLw_fQU5VuXt.mjs} +1 -1
- package/node/esm/{BpMTlTrJLWh_wJ5H.mjs → BP9JmWMpUInDk4OG.mjs} +1 -1
- package/node/esm/{DTHN_EkuOscW3f3B.mjs → CDh1Fw2maXvyOhIs.mjs} +1 -1
- package/node/esm/{DP0M3_S_dwLwRMiA.mjs → K4Xw9Ur7uFf9M5Gh.mjs} +1 -1
- package/node/esm/index.mjs +10619 -10526
- package/package.json +6 -6
- package/types/scripting-api.json +7085 -7083
- package/types/scripting.d.ts +25 -11
- package/types/src/lib/utils/utils.browser.d.ts +5 -0
- package/types/src/license/LicenseDetails.d.ts +1 -0
- package/types/src/license/LicenseManager.d.ts +4 -1
- package/types/src/license/license-key.d.ts +22 -2
- package/browser/cjs/DjWcveVCs0NFiKep.cjs +0 -1
package/types/scripting.d.ts
CHANGED
|
@@ -97,11 +97,14 @@ declare global {
|
|
|
97
97
|
/**
|
|
98
98
|
* Add a resource ROOT, searched ahead of anything the packages ship.
|
|
99
99
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
100
|
+
* In the browser this is required to load anything beyond the bundled default language — there is
|
|
101
|
+
* no implicit root. An app that stages resources with `ResourcesPlugin` (or `stageResources`) serves
|
|
102
|
+
* them at `/resources`, so it calls `addResourceRoot('/resources')`.
|
|
103
|
+
*
|
|
104
|
+
* May be called before or after packages load; already-registered packages re-discover their locales.
|
|
105
|
+
*
|
|
106
|
+
* @param root a URL prefix (browser) or directory (node) laid out as `<root>/<kind>/<pkg>/<relPath>`,
|
|
107
|
+
* or a custom {@link ResourceRoot}.
|
|
105
108
|
*/
|
|
106
109
|
export function addResourceRoot(root: string | ResourceRoot): void;
|
|
107
110
|
|
|
@@ -2235,8 +2238,8 @@ declare global {
|
|
|
2235
2238
|
*/
|
|
2236
2239
|
export function getLocaleProfile(tag: string, overrides?: LocaleProfileOverrides | null): LocaleProfile;
|
|
2237
2240
|
|
|
2238
|
-
/** The
|
|
2239
|
-
export function getLocaleResourceBase(): string;
|
|
2241
|
+
/** The configured base, or `null` when none has been set. */
|
|
2242
|
+
export function getLocaleResourceBase(): string | null;
|
|
2240
2243
|
|
|
2241
2244
|
export function getScriptingApi(): Promise<ScriptingApi.Index>;
|
|
2242
2245
|
|
|
@@ -33843,6 +33846,7 @@ declare global {
|
|
|
33843
33846
|
export interface LicenseDetails {
|
|
33844
33847
|
getLicensee(): string | null;
|
|
33845
33848
|
getExpiration(): Date | null;
|
|
33849
|
+
getRuntimes(): ('browser' | 'server')[];
|
|
33846
33850
|
getDomains(): string[];
|
|
33847
33851
|
getCpuCount(): number;
|
|
33848
33852
|
getMemory(): number;
|
|
@@ -33929,7 +33933,10 @@ declare global {
|
|
|
33929
33933
|
/**
|
|
33930
33934
|
* Set the license key provided by SheetXL.
|
|
33931
33935
|
* @remarks
|
|
33932
|
-
*
|
|
33936
|
+
* Without a call to this, the key is looked for where it runs:
|
|
33937
|
+
* - In a browser, a file named `sheetxl.lic` served beside the page.
|
|
33938
|
+
* - Outside a browser (Node, Bun, Deno, CI), the `SHEETXL_LICENSE_KEY` environment variable, then
|
|
33939
|
+
* the key saved by `sheetxl license activate`.
|
|
33933
33940
|
*
|
|
33934
33941
|
* @param licenseKey The license key as a string.
|
|
33935
33942
|
* @param force If set to `true` will replace an existing key.
|
|
@@ -34684,6 +34691,13 @@ declare global {
|
|
|
34684
34691
|
[K in keyof T]: Required<Pick<T, K>> & Partial<Record<Exclude<keyof T, K>, never>>;
|
|
34685
34692
|
}[keyof T];
|
|
34686
34693
|
|
|
34694
|
+
/**
|
|
34695
|
+
* Listen for the set of places resources are loaded from changing — a root added or the base set.
|
|
34696
|
+
*
|
|
34697
|
+
* Locale discovery subscribes to this so a root added after a package registered still contributes.
|
|
34698
|
+
*/
|
|
34699
|
+
export function onResourceRootsChange(listener: () => void): RemoveListener;
|
|
34700
|
+
|
|
34687
34701
|
export interface OrientationFlags {
|
|
34688
34702
|
vertical: boolean;
|
|
34689
34703
|
horizontal: boolean;
|
|
@@ -35397,7 +35411,7 @@ declare global {
|
|
|
35397
35411
|
export function resolveLocaleChain(tag: string, locales: Record<string, LocaleIndexEntry | undefined>): string[];
|
|
35398
35412
|
|
|
35399
35413
|
/**
|
|
35400
|
-
* Resolve a locale resource URL: `<base><pkg>/<relPath
|
|
35414
|
+
* Resolve a locale resource URL: `<base><pkg>/<relPath>`, or `null` when no base is configured.
|
|
35401
35415
|
*
|
|
35402
35416
|
* Browser-shaped, and only describes the BASE — it does not account for resource roots, which may
|
|
35403
35417
|
* outrank it. Use {@link fetchLocaleResource} to actually load.
|
|
@@ -35405,7 +35419,7 @@ declare global {
|
|
|
35405
35419
|
* @param pkg the owning package id, e.g. `'@sheetxl/react'`
|
|
35406
35420
|
* @param relPath the path within that package's `locales/`, e.g. `'de/model.msg.json'` or `'inherit.json'`
|
|
35407
35421
|
*/
|
|
35408
|
-
export function resolveLocaleResource(pkg: string, relPath: string): string;
|
|
35422
|
+
export function resolveLocaleResource(pkg: string, relPath: string): string | null;
|
|
35409
35423
|
|
|
35410
35424
|
/**
|
|
35411
35425
|
* The log timeout in effect, in milliseconds: the first candidate that is a non-negative number,
|
|
@@ -35789,7 +35803,7 @@ declare global {
|
|
|
35789
35803
|
/**
|
|
35790
35804
|
* Set the base under which package locale resources are served.
|
|
35791
35805
|
*
|
|
35792
|
-
* In the browser this is a URL prefix
|
|
35806
|
+
* In the browser this is a URL prefix, e.g. `'/resources/locales/'`. In node it is a DIRECTORY.
|
|
35793
35807
|
* Unlike a resource ROOT it names the kind itself, so it holds `<pkg>/<relPath>` directly with no
|
|
35794
35808
|
* `locales/` segment — leave it unset in node unless the host stages the files that way.
|
|
35795
35809
|
*/
|
|
@@ -21,6 +21,11 @@ export declare function getLocation(): string;
|
|
|
21
21
|
* The OS platform, used by the `INFO("system")` formula.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getOS(): string;
|
|
24
|
+
/**
|
|
25
|
+
* The key in a `sheetxl.lic` served beside the page: its first line that is not blank or a `#`
|
|
26
|
+
* comment. A server that answers every path with its app page (a single-page app's fallback) sends
|
|
27
|
+
* HTML with a 200, so an HTML response is no key rather than an invalid one.
|
|
28
|
+
*/
|
|
24
29
|
export declare function findLicenseKey(): Promise<{
|
|
25
30
|
key: string;
|
|
26
31
|
from: string;
|
|
@@ -4,7 +4,10 @@ declare class LM {
|
|
|
4
4
|
/**
|
|
5
5
|
* Set the license key provided by SheetXL.
|
|
6
6
|
* @remarks
|
|
7
|
-
*
|
|
7
|
+
* Without a call to this, the key is looked for where it runs:
|
|
8
|
+
* - In a browser, a file named `sheetxl.lic` served beside the page.
|
|
9
|
+
* - Outside a browser (Node, Bun, Deno, CI), the `SHEETXL_LICENSE_KEY` environment variable, then
|
|
10
|
+
* the key saved by `sheetxl license activate`.
|
|
8
11
|
*
|
|
9
12
|
* @param licenseKey The license key as a string.
|
|
10
13
|
* @param force If set to `true` will replace an existing key.
|
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
import { LicenseDetails } from './LicenseDetails';
|
|
2
|
+
/**
|
|
3
|
+
* Where a license runs. `browser` is any page (checked against its origin); `server` is any
|
|
4
|
+
* JavaScript runtime outside a browser - Node, Bun, Deno, the CLI, a CI runner (checked against the
|
|
5
|
+
* machine).
|
|
6
|
+
*/
|
|
7
|
+
export type LicenseRuntime = 'browser' | 'server';
|
|
8
|
+
export declare const LICENSE_RUNTIMES: readonly LicenseRuntime[];
|
|
2
9
|
export interface Decoded {
|
|
3
10
|
licensee?: string | null;
|
|
4
11
|
type?: string;
|
|
5
12
|
expiry?: number;
|
|
6
13
|
developerCount?: number;
|
|
14
|
+
/** The runtimes the key covers; `undefined` for a key issued before runtimes were explicit. */
|
|
15
|
+
runtimes?: LicenseRuntime[];
|
|
7
16
|
domains?: string[];
|
|
8
17
|
fingerprint?: string | null;
|
|
9
18
|
cpuCount?: number;
|
|
10
19
|
memory?: number | null;
|
|
11
20
|
features?: Record<string, any>[];
|
|
12
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The runtimes a decoded key covers. A key issued before runtimes were explicit covers `browser`
|
|
24
|
+
* when it has origins, and `server` unless its cpu and memory are both 0 (the old browser-only
|
|
25
|
+
* marker).
|
|
26
|
+
*/
|
|
27
|
+
export declare function getRuntimes(decoded: Decoded): LicenseRuntime[];
|
|
13
28
|
export interface LicenseAndKey {
|
|
14
29
|
details: LicenseDetails;
|
|
15
30
|
key: string;
|
|
16
31
|
}
|
|
17
32
|
export interface LicenseKeyDetails {
|
|
18
33
|
licensee: string;
|
|
19
|
-
type?: string;
|
|
34
|
+
type?: string | null;
|
|
20
35
|
expiration?: string | null;
|
|
21
36
|
developerCount?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The runtimes the key covers. Defaults to what the other terms imply: `browser` when there are
|
|
39
|
+
* origins, `server` when there is a fingerprint, cpu count or memory.
|
|
40
|
+
*/
|
|
41
|
+
runtimes?: LicenseRuntime[] | null;
|
|
22
42
|
/** Licensed origins, `<protocol>://<host>` each (see `Origin`); a string is comma-separated. */
|
|
23
|
-
domains?: string | string[];
|
|
43
|
+
domains?: string | string[] | null;
|
|
24
44
|
fingerprint?: string | null;
|
|
25
45
|
cpuCount?: number | null;
|
|
26
46
|
memory?: number | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./B44p8LIyxG3GtaGC.cjs");exports.initializeFunctions=e.R;
|