@localess/client 3.0.1-dev.20260410071322 → 3.0.1-dev.20260412201733

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.mjs CHANGED
@@ -1,259 +1,135 @@
1
- // src/utils.ts
2
- var RESET = "\x1B[0m";
3
- var FG_BLUE = "\x1B[34m";
4
- var isBrowser = () => typeof window !== "undefined";
5
- var isServer = () => typeof window === "undefined";
6
- var isIframe = () => isBrowser() && window.self !== window.top;
7
-
8
- // src/cache.ts
9
- var NoCache = class {
10
- set(key, value) {
11
- }
12
- get(key) {
13
- return void 0;
14
- }
15
- has(key) {
16
- return false;
17
- }
18
- };
19
- var TTLCache = class {
20
- /**
21
- * Creates a TTLCache with a specified time-to-live (TTL) for each entry.
22
- * default is 5 minutes (300000 ms).
23
- * @param ttlMs
24
- */
25
- constructor(ttlMs = 3e5) {
26
- this.ttlMs = ttlMs;
27
- }
28
- ttlMs;
29
- cache = /* @__PURE__ */ new Map();
30
- set(key, value) {
31
- this.cache.set(key, { value, expiresAt: Date.now() + this.ttlMs });
32
- }
33
- get(key) {
34
- const entry = this.cache.get(key);
35
- if (!entry) return void 0;
36
- if (Date.now() > entry.expiresAt) {
37
- this.cache.delete(key);
38
- return void 0;
39
- }
40
- return entry.value;
41
- }
42
- has(key) {
43
- return this.get(key) !== void 0;
44
- }
45
- };
46
-
47
- // src/client.ts
48
- var LOG_GROUP = `${FG_BLUE}[Localess:Client]${RESET}`;
49
- function localessClient(options) {
50
- if (options.debug) {
51
- console.log(LOG_GROUP, "Client Options : ", options);
52
- }
53
- const normalizedOrigin = options.origin.replace(/\/+$/, "");
54
- const fetchOptions = {
55
- redirect: "follow",
56
- headers: {
57
- "Content-Type": "application/json",
58
- "Accept": "application/json",
59
- "X-Localess-Agent": "Localess-JS-Client",
60
- "X-Localess-Agent-Version": "0.9.0"
61
- }
62
- };
63
- const cache = options.cacheTTL === false ? new NoCache() : new TTLCache(options.cacheTTL);
64
- return {
65
- async getLinks(params) {
66
- if (options.debug) {
67
- console.log(LOG_GROUP, "getLinks() params : ", JSON.stringify(params));
68
- }
69
- let kind = "";
70
- if (params?.kind) {
71
- kind = `&kind=${params.kind}`;
72
- }
73
- let parentSlug = "";
74
- if (params?.parentSlug) {
75
- parentSlug = `&parentSlug=${params.parentSlug}`;
76
- }
77
- let excludeChildren = "";
78
- if (params?.excludeChildren) {
79
- excludeChildren = `&excludeChildren=${params.excludeChildren}`;
80
- }
81
- let url = `${normalizedOrigin}/api/v1/spaces/${options.spaceId}/links?token=${options.token}${kind}${parentSlug}${excludeChildren}`;
82
- if (options.debug) {
83
- console.log(LOG_GROUP, "getLinks fetch url : ", url);
84
- }
85
- if (cache.has(url)) {
86
- if (options.debug) {
87
- console.log(LOG_GROUP, "getLinks cache hit");
88
- }
89
- return cache.get(url);
90
- }
91
- try {
92
- const response = await fetch(url, fetchOptions);
93
- if (options.debug) {
94
- console.log(LOG_GROUP, "getLinks status : ", response.status);
95
- }
96
- const data = await response.json();
97
- cache.set(url, data);
98
- return data;
99
- } catch (error) {
100
- console.error(LOG_GROUP, "getLinks error : ", error);
101
- return {};
102
- }
103
- },
104
- async getContentBySlug(slug, params) {
105
- if (options.debug) {
106
- console.log(LOG_GROUP, "getContentBySlug() slug : ", slug);
107
- console.log(LOG_GROUP, "getContentBySlug() params : ", JSON.stringify(params));
108
- }
109
- let version = "";
110
- if (options?.version && options.version == "draft") {
111
- version = `&version=${options.version}`;
112
- }
113
- if (params?.version && params.version == "draft") {
114
- version = `&version=${params.version}`;
115
- }
116
- const locale = params?.locale ? `&locale=${params.locale}` : "";
117
- const resolveReference = params?.resolveReference ? `&resolveReference=${params.resolveReference}` : "";
118
- const resolveLink = params?.resolveLink ? `&resolveLink=${params.resolveLink}` : "";
119
- let url = `${normalizedOrigin}/api/v1/spaces/${options.spaceId}/contents/slugs/${slug}?token=${options.token}${version}${locale}${resolveReference}${resolveLink}`;
120
- if (options.debug) {
121
- console.log(LOG_GROUP, "getContentBySlug fetch url : ", url);
122
- }
123
- if (cache.has(url)) {
124
- if (options.debug) {
125
- console.log(LOG_GROUP, "getContentBySlug cache hit");
126
- }
127
- return cache.get(url);
128
- }
129
- try {
130
- const response = await fetch(url, fetchOptions);
131
- if (options.debug) {
132
- console.log(LOG_GROUP, "getContentBySlug status : ", response.status);
133
- }
134
- const data = await response.json();
135
- cache.set(url, data);
136
- return data;
137
- } catch (error) {
138
- console.error(LOG_GROUP, "getContentBySlug error : ", error);
139
- return {};
140
- }
141
- },
142
- async getContentById(id, params) {
143
- if (options.debug) {
144
- console.log(LOG_GROUP, "getContentById() id : ", id);
145
- console.log(LOG_GROUP, "getContentById() params : ", JSON.stringify(params));
146
- }
147
- let version = "";
148
- if (options?.version && options.version == "draft") {
149
- version = `&version=${options.version}`;
150
- }
151
- if (params?.version && params.version == "draft") {
152
- version = `&version=${params.version}`;
153
- }
154
- const locale = params?.locale ? `&locale=${params.locale}` : "";
155
- const resolveReference = params?.resolveReference ? `&resolveReference=${params.resolveReference}` : "";
156
- const resolveLink = params?.resolveLink ? `&resolveLink=${params.resolveLink}` : "";
157
- let url = `${normalizedOrigin}/api/v1/spaces/${options.spaceId}/contents/${id}?token=${options.token}${version}${locale}${resolveReference}${resolveLink}`;
158
- if (options.debug) {
159
- console.log(LOG_GROUP, "getContentById fetch url : ", url);
160
- }
161
- if (cache.has(url)) {
162
- if (options.debug) {
163
- console.log(LOG_GROUP, "getContentById cache hit");
164
- }
165
- return cache.get(url);
166
- }
167
- try {
168
- const response = await fetch(url, fetchOptions);
169
- if (options.debug) {
170
- console.log(LOG_GROUP, "getContentById status : ", response.status);
171
- }
172
- const data = await response.json();
173
- cache.set(url, data);
174
- return data;
175
- } catch (error) {
176
- console.error(LOG_GROUP, "getContentById error : ", error);
177
- return {};
178
- }
179
- },
180
- async getTranslations(locale) {
181
- if (options.debug) {
182
- console.log(LOG_GROUP, "getTranslations() locale : ", locale);
183
- }
184
- let url = `${normalizedOrigin}/api/v1/spaces/${options.spaceId}/translations/${locale}?token=${options.token}`;
185
- if (options.debug) {
186
- console.log(LOG_GROUP, "getTranslations fetch url : ", url);
187
- }
188
- if (cache.has(url)) {
189
- if (options.debug) {
190
- console.log(LOG_GROUP, "getTranslations cache hit");
191
- }
192
- return cache.get(url);
193
- }
194
- try {
195
- const response = await fetch(url, fetchOptions);
196
- if (options.debug) {
197
- console.log(LOG_GROUP, "getTranslations status : ", response.status);
198
- }
199
- const data = await response.json();
200
- cache.set(url, data);
201
- return data;
202
- } catch (error) {
203
- console.error(LOG_GROUP, "getTranslations error : ", error);
204
- return {};
205
- }
206
- },
207
- syncScriptUrl() {
208
- return `${normalizedOrigin}/scripts/sync-v1.js`;
209
- },
210
- assetLink(asset) {
211
- if (typeof asset === "string") {
212
- return `${normalizedOrigin}/api/v1/spaces/${options.spaceId}/assets/${asset}`;
213
- } else {
214
- return `${normalizedOrigin}/api/v1/spaces/${options.spaceId}/assets/${asset.uri}`;
215
- }
216
- }
217
- };
1
+ //#region src/utils.ts
2
+ var e = "\x1B[0m", t = "\x1B[34m", n = () => typeof window < "u", r = () => typeof window > "u", i = () => n() && window.self !== window.top, a = class {
3
+ set(e, t) {}
4
+ get(e) {}
5
+ has(e) {
6
+ return !1;
7
+ }
8
+ }, o = class {
9
+ cache = /* @__PURE__ */ new Map();
10
+ constructor(e = 3e5) {
11
+ this.ttlMs = e;
12
+ }
13
+ set(e, t) {
14
+ this.cache.set(e, {
15
+ value: t,
16
+ expiresAt: Date.now() + this.ttlMs
17
+ });
18
+ }
19
+ get(e) {
20
+ let t = this.cache.get(e);
21
+ if (t) {
22
+ if (Date.now() > t.expiresAt) {
23
+ this.cache.delete(e);
24
+ return;
25
+ }
26
+ return t.value;
27
+ }
28
+ }
29
+ has(e) {
30
+ return this.get(e) !== void 0;
31
+ }
32
+ }, s = `${t}[Localess:Client]${e}`;
33
+ function c(e) {
34
+ e.debug && console.log(s, "Client Options : ", e);
35
+ let t = e.origin.replace(/\/+$/, ""), n = {
36
+ redirect: "follow",
37
+ headers: {
38
+ "Content-Type": "application/json",
39
+ Accept: "application/json",
40
+ "X-Localess-Agent": "Localess-JS-Client",
41
+ "X-Localess-Agent-Version": "0.9.0"
42
+ }
43
+ }, r = e.cacheTTL === !1 ? new a() : new o(e.cacheTTL);
44
+ return {
45
+ async getLinks(i) {
46
+ e.debug && console.log(s, "getLinks() params : ", JSON.stringify(i));
47
+ let a = "";
48
+ i?.kind && (a = `&kind=${i.kind}`);
49
+ let o = "";
50
+ i?.parentSlug && (o = `&parentSlug=${i.parentSlug}`);
51
+ let c = "";
52
+ i?.excludeChildren && (c = `&excludeChildren=${i.excludeChildren}`);
53
+ let l = `${t}/api/v1/spaces/${e.spaceId}/links?token=${e.token}${a}${o}${c}`;
54
+ if (e.debug && console.log(s, "getLinks fetch url : ", l), r.has(l)) return e.debug && console.log(s, "getLinks cache hit"), r.get(l);
55
+ try {
56
+ let t = await fetch(l, n);
57
+ e.debug && console.log(s, "getLinks status : ", t.status);
58
+ let i = await t.json();
59
+ return r.set(l, i), i;
60
+ } catch (e) {
61
+ return console.error(s, "getLinks error : ", e), {};
62
+ }
63
+ },
64
+ async getContentBySlug(i, a) {
65
+ e.debug && (console.log(s, "getContentBySlug() slug : ", i), console.log(s, "getContentBySlug() params : ", JSON.stringify(a)));
66
+ let o = "";
67
+ e?.version && e.version == "draft" && (o = `&version=${e.version}`), a?.version && a.version == "draft" && (o = `&version=${a.version}`);
68
+ let c = a?.locale ? `&locale=${a.locale}` : "", l = a?.resolveReference ? `&resolveReference=${a.resolveReference}` : "", u = a?.resolveLink ? `&resolveLink=${a.resolveLink}` : "", d = `${t}/api/v1/spaces/${e.spaceId}/contents/slugs/${i}?token=${e.token}${o}${c}${l}${u}`;
69
+ if (e.debug && console.log(s, "getContentBySlug fetch url : ", d), r.has(d)) return e.debug && console.log(s, "getContentBySlug cache hit"), r.get(d);
70
+ try {
71
+ let t = await fetch(d, n);
72
+ e.debug && console.log(s, "getContentBySlug status : ", t.status);
73
+ let i = await t.json();
74
+ return r.set(d, i), i;
75
+ } catch (e) {
76
+ return console.error(s, "getContentBySlug error : ", e), {};
77
+ }
78
+ },
79
+ async getContentById(i, a) {
80
+ e.debug && (console.log(s, "getContentById() id : ", i), console.log(s, "getContentById() params : ", JSON.stringify(a)));
81
+ let o = "";
82
+ e?.version && e.version == "draft" && (o = `&version=${e.version}`), a?.version && a.version == "draft" && (o = `&version=${a.version}`);
83
+ let c = a?.locale ? `&locale=${a.locale}` : "", l = a?.resolveReference ? `&resolveReference=${a.resolveReference}` : "", u = a?.resolveLink ? `&resolveLink=${a.resolveLink}` : "", d = `${t}/api/v1/spaces/${e.spaceId}/contents/${i}?token=${e.token}${o}${c}${l}${u}`;
84
+ if (e.debug && console.log(s, "getContentById fetch url : ", d), r.has(d)) return e.debug && console.log(s, "getContentById cache hit"), r.get(d);
85
+ try {
86
+ let t = await fetch(d, n);
87
+ e.debug && console.log(s, "getContentById status : ", t.status);
88
+ let i = await t.json();
89
+ return r.set(d, i), i;
90
+ } catch (e) {
91
+ return console.error(s, "getContentById error : ", e), {};
92
+ }
93
+ },
94
+ async getTranslations(i) {
95
+ e.debug && console.log(s, "getTranslations() locale : ", i);
96
+ let a = `${t}/api/v1/spaces/${e.spaceId}/translations/${i}?token=${e.token}`;
97
+ if (e.debug && console.log(s, "getTranslations fetch url : ", a), r.has(a)) return e.debug && console.log(s, "getTranslations cache hit"), r.get(a);
98
+ try {
99
+ let t = await fetch(a, n);
100
+ e.debug && console.log(s, "getTranslations status : ", t.status);
101
+ let i = await t.json();
102
+ return r.set(a, i), i;
103
+ } catch (e) {
104
+ return console.error(s, "getTranslations error : ", e), {};
105
+ }
106
+ },
107
+ syncScriptUrl() {
108
+ return `${t}/scripts/sync-v1.js`;
109
+ },
110
+ assetLink(n) {
111
+ return typeof n == "string" ? `${t}/api/v1/spaces/${e.spaceId}/assets/${n}` : `${t}/api/v1/spaces/${e.spaceId}/assets/${n.uri}`;
112
+ }
113
+ };
218
114
  }
219
-
220
- // src/editable.ts
221
- function localessEditable(content) {
222
- return {
223
- "data-ll-id": content._id,
224
- "data-ll-schema": content._schema
225
- };
115
+ //#endregion
116
+ //#region src/editable.ts
117
+ function l(e) {
118
+ return {
119
+ "data-ll-id": e._id,
120
+ "data-ll-schema": e._schema
121
+ };
226
122
  }
227
- function localessEditableField(fieldName) {
228
- return {
229
- "data-ll-field": fieldName
230
- };
123
+ function u(e) {
124
+ return { "data-ll-field": e };
231
125
  }
232
-
233
- // src/sync.ts
234
- var JS_SYNC_ID = "localess-js-sync";
235
- function loadLocalessSync(origin, force = false) {
236
- if (isServer()) return;
237
- if (!isIframe()) return;
238
- const isSyncLoaded = typeof window.localess !== "undefined";
239
- if (isSyncLoaded) return;
240
- const scriptEl = document.getElementById(JS_SYNC_ID);
241
- if (scriptEl) return;
242
- const script = document.createElement("script");
243
- script.id = JS_SYNC_ID;
244
- script.type = "text/javascript";
245
- script.src = `${origin}/scripts/sync-v1.js`;
246
- script.async = true;
247
- script.onerror = (error) => console.error(error);
248
- script.onload = (event) => console.info("Localess Sync Script loaded");
249
- document.head.appendChild(script);
126
+ //#endregion
127
+ //#region src/sync.ts
128
+ var d = "localess-js-sync";
129
+ function f(e, t = !1) {
130
+ if (r() || !i() || window.localess !== void 0 || document.getElementById(d)) return;
131
+ let n = document.createElement("script");
132
+ n.id = d, n.type = "text/javascript", n.src = `${e}/scripts/sync-v1.js`, n.async = !0, n.onerror = (e) => console.error(e), n.onload = (e) => console.info("Localess Sync Script loaded"), document.head.appendChild(n);
250
133
  }
251
- export {
252
- isBrowser,
253
- isIframe,
254
- isServer,
255
- loadLocalessSync,
256
- localessClient,
257
- localessEditable,
258
- localessEditableField
259
- };
134
+ //#endregion
135
+ export { n as isBrowser, i as isIframe, r as isServer, f as loadLocalessSync, c as localessClient, l as localessEditable, u as localessEditableField };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Content Asset defines reference to an Asset.
3
+ */
4
+ export interface ContentAsset {
5
+ /**
6
+ * Define the type of Asset
7
+ */
8
+ kind: 'ASSET';
9
+ /**
10
+ * Unique identifier for the asset.
11
+ */
12
+ uri: string;
13
+ }
@@ -0,0 +1,27 @@
1
+ import { ContentAsset } from './content-asset';
2
+ import { ContentLink } from './content-link';
3
+ import { ContentRichText } from './content-rich-text';
4
+ import { ContentReference } from './content-reference';
5
+ export type ContentDataField = any | string | string[] | number | boolean | ContentLink | ContentRichText | ContentData | ContentData[] | ContentAsset | ContentAsset[] | ContentReference | ContentReference[];
6
+ /**
7
+ * Content Data Schema related information.
8
+ */
9
+ export interface ContentDataSchema {
10
+ /**
11
+ * Unique identifier of a component in a content.
12
+ */
13
+ _id: string;
14
+ /**
15
+ * Unique identifier for the Schema object.
16
+ */
17
+ _schema: string;
18
+ }
19
+ /**
20
+ * ContentData defined Object to connect all possible root Schemas.
21
+ */
22
+ export interface ContentData extends ContentDataSchema {
23
+ /**
24
+ * Other Schema-specific fields
25
+ */
26
+ [field: string]: ContentDataField | undefined;
27
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Content Link define reference to a Link.
3
+ */
4
+ export interface ContentLink {
5
+ /**
6
+ * Define the type of Link
7
+ */
8
+ kind: 'LINK';
9
+ /**
10
+ * Define the target of the link. _blank for the new tab and _self for the same tab.
11
+ */
12
+ target: '_blank' | '_self';
13
+ /**
14
+ * Define the type of Link. URL for external links and Content for internal links.
15
+ */
16
+ type: 'url' | 'content';
17
+ /**
18
+ * If the type is content, then it will be Content ID. Otherwise, it will be URL.
19
+ */
20
+ uri: string;
21
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Content Metadata defines short information about a Content for navigation reason.
3
+ */
4
+ export interface ContentMetadata {
5
+ /**
6
+ * Date and Time at which the Content was created.
7
+ */
8
+ createdAt: string;
9
+ /**
10
+ * Combination of SLUG and Parent SLUG of the Content
11
+ */
12
+ fullSlug: string;
13
+ /**
14
+ * Unique identifier for the object.
15
+ */
16
+ id: string;
17
+ /**
18
+ * Define the type of Content, whether it is a FOLDER or DOCUMENT.
19
+ */
20
+ kind: 'FOLDER' | 'DOCUMENT';
21
+ /**
22
+ * Name of the Content
23
+ */
24
+ name: string;
25
+ /**
26
+ * Parent SLUG of the Content
27
+ */
28
+ parentSlug: string;
29
+ /**
30
+ * Date and Time at which the Content was published.
31
+ */
32
+ publishedAt?: string;
33
+ /**
34
+ * SLUG of the Content
35
+ */
36
+ slug: string;
37
+ /**
38
+ * Date and Time at which the Content was updated.
39
+ */
40
+ updatedAt: string;
41
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Content Reference defines reference to a Content.
3
+ */
4
+ export interface ContentReference {
5
+ /**
6
+ * Define the type of REFERENCE
7
+ */
8
+ kind: 'REFERENCE';
9
+ /**
10
+ * Unique identifier for the Content Document.
11
+ */
12
+ uri: string;
13
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Content RichText define content as JSON Object.
3
+ */
4
+ export interface ContentRichText {
5
+ /**
6
+ * Define the type of Content Node
7
+ */
8
+ type?: string;
9
+ /**
10
+ * List of Content Nodes
11
+ */
12
+ content?: ContentRichText[];
13
+ }
@@ -0,0 +1,21 @@
1
+ import { ContentData } from './content-data';
2
+ import { ContentMetadata } from './content-metadata';
3
+ import { Links } from './links';
4
+ import { References } from './references';
5
+ /**
6
+ * Content defines a shared object for all possible Content Types.
7
+ */
8
+ export interface Content<T extends ContentData = ContentData> extends ContentMetadata {
9
+ /**
10
+ * Content Data
11
+ */
12
+ data?: T;
13
+ /**
14
+ * All links used in the content.
15
+ */
16
+ links?: Links;
17
+ /**
18
+ * All references used in the content.
19
+ */
20
+ references?: References;
21
+ }
@@ -0,0 +1,11 @@
1
+ export * from './content';
2
+ export * from './content-asset';
3
+ export * from './content-data';
4
+ export * from './content-link';
5
+ export * from './content-metadata';
6
+ export * from './content-reference';
7
+ export * from './content-rich-text';
8
+ export * from './links';
9
+ export * from './locale';
10
+ export * from './references';
11
+ export * from './translations';
@@ -0,0 +1,7 @@
1
+ import { ContentMetadata } from './content-metadata';
2
+ /**
3
+ * Key-Value Object. Where Key is a Unique identifier for the Content object and Value is Content Metadata.
4
+ */
5
+ export interface Links {
6
+ [key: string]: ContentMetadata;
7
+ }
@@ -0,0 +1,10 @@
1
+ export interface Locale {
2
+ /**
3
+ * Unique identifier for the Locale.
4
+ */
5
+ id: string;
6
+ /**
7
+ * Name of the Locale.
8
+ */
9
+ name: string;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { Content } from './content';
2
+ /**
3
+ * Key-Value Object. Where Key is a Unique identifier for the Content object and Value is Content.
4
+ */
5
+ export interface References {
6
+ [key: string]: Content;
7
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Key-Value Object. Where Key is Translation ID and Value is Translated Content
3
+ */
4
+ export interface Translations {
5
+ [key: string]: string;
6
+ }
package/dist/sync.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Inject Localess Sync Script in Header
3
+ * @param {string} origin A fully qualified domain name with protocol (http/https) and port.
4
+ * @param {boolean} force Force Script Injection even if the application is not in Visual Editor.
5
+ */
6
+ export declare function loadLocalessSync(origin: string, force?: boolean): void;
@@ -0,0 +1,43 @@
1
+ export declare function proxyURIFromEnv(): string | undefined;
2
+ export declare const RESET = "\u001B[0m";
3
+ export declare const BRIGHT = "\u001B[1m";
4
+ export declare const DIM = "\u001B[2m";
5
+ export declare const UNDERSCORE = "\u001B[4m";
6
+ export declare const BLINK = "\u001B[5m";
7
+ export declare const REVERSE = "\u001B[7m";
8
+ export declare const HIDDEN = "\u001B[8m";
9
+ export declare const FG_BLACK = "\u001B[30m";
10
+ export declare const FG_RED = "\u001B[31m";
11
+ export declare const FG_GREEN = "\u001B[32m";
12
+ export declare const FG_YELLOW = "\u001B[33m";
13
+ export declare const FG_BLUE = "\u001B[34m";
14
+ export declare const FG_MAGENTA = "\u001B[35m";
15
+ export declare const FG_CYAN = "\u001B[36m";
16
+ export declare const FG_WHITE = "\u001B[37m";
17
+ export declare const FG_GRAY = "\u001B[90m";
18
+ export declare const FG_BRIGHT_RED = "\u001B[91m";
19
+ export declare const FG_BRIGHT_GREEN = "\u001B[92m";
20
+ export declare const FG_BRIGHT_YELLOW = "\u001B[93m";
21
+ export declare const FG_BRIGHT_BLUE = "\u001B[94m";
22
+ export declare const FG_BRIGHT_MAGENTA = "\u001B[95m";
23
+ export declare const FG_BRIGHT_CYAN = "\u001B[96m";
24
+ export declare const FG_BRIGHT_WHITE = "\u001B[97m";
25
+ export declare const BG_BLACK = "\u001B[40m";
26
+ export declare const BG_RED = "\u001B[41m";
27
+ export declare const BG_GREEN = "\u001B[42m";
28
+ export declare const BG_YELLOW = "\u001B[43m";
29
+ export declare const BG_BLUE = "\u001B[44m";
30
+ export declare const BG_MAGENTA = "\u001B[45m";
31
+ export declare const BG_CYAN = "\u001B[46m";
32
+ export declare const BG_WHITE = "\u001B[47m";
33
+ export declare const BG_GRAY = "\u001B[100m";
34
+ export declare const BG_BRIGHT_RED = "\u001B[101m";
35
+ export declare const BG_BRIGHT_GREEN = "\u001B[102m";
36
+ export declare const BG_BRIGHT_YELLOW = "\u001B[103m";
37
+ export declare const BG_BRIGHT_BLUE = "\u001B[104m";
38
+ export declare const BG_BRIGHT_MAGENTA = "\u001B[105m";
39
+ export declare const BG_BRIGHT_CYAN = "\u001B[106m";
40
+ export declare const BG_BRIGHT_WHITE = "\u001B[107m";
41
+ export declare const isBrowser: () => boolean;
42
+ export declare const isServer: () => boolean;
43
+ export declare const isIframe: () => boolean;