@knock-ai/sdk 0.1.2 → 0.1.4
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/README.md +27 -5
- package/dist/contract.cjs +1 -1
- package/dist/contract.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/knockai.iife.js +2 -2
- package/dist/knockai.iife.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/snippet.js +1 -1
- package/dist/snippet.js.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/types/core/bridge.d.cts +3 -2
- package/dist/types/core/bridge.d.ts +3 -2
- package/dist/types/core/bridge.d.ts.map +1 -1
- package/dist/types/core/chat-types.d.cts +78 -0
- package/dist/types/core/chat-types.d.ts +79 -0
- package/dist/types/core/chat-types.d.ts.map +1 -0
- package/dist/types/core/contract.d.cts +1 -1
- package/dist/types/core/contract.d.ts +1 -1
- package/dist/types/core/contract.d.ts.map +1 -1
- package/dist/types/core/emitter.d.cts +0 -1
- package/dist/types/core/emitter.d.ts +0 -1
- package/dist/types/core/emitter.d.ts.map +1 -1
- package/dist/types/core/index.d.cts +2 -1
- package/dist/types/core/index.d.ts +2 -1
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/loader.d.cts +4 -3
- package/dist/types/core/loader.d.ts +4 -3
- package/dist/types/core/loader.d.ts.map +1 -1
- package/dist/types/core/queue.d.cts +2 -2
- package/dist/types/core/queue.d.ts +2 -2
- package/dist/types/core/queue.d.ts.map +1 -1
- package/dist/types/core/types.d.cts +214 -0
- package/dist/types/core/types.d.ts +214 -0
- package/dist/types/core/types.d.ts.map +1 -1
- package/dist/types/core/version.d.cts +1 -1
- package/dist/types/core/version.d.ts +1 -1
- package/dist/types/frameworks/react/KnockLink.d.cts +15 -0
- package/dist/types/frameworks/react/KnockLink.d.ts +16 -0
- package/dist/types/frameworks/react/KnockLink.d.ts.map +1 -0
- package/dist/types/frameworks/react/index.d.cts +2 -0
- package/dist/types/frameworks/react/index.d.ts +2 -0
- package/dist/types/frameworks/react/index.d.ts.map +1 -1
- package/dist/types/testing/index.d.cts +19 -1
- package/dist/types/testing/index.d.ts +19 -1
- package/dist/types/testing/index.d.ts.map +1 -1
- package/package.json +12 -7
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversation as a vendor's own chat UI gets it. This file is the one definition of these types: it imports
|
|
3
|
+
* nothing and names nothing of the DOM, so knock-sdk compiles a copy of it as it is.
|
|
4
|
+
*/
|
|
5
|
+
/** The page's one conversation as data, and what the visitor can do in it. */
|
|
6
|
+
export interface KnockChatClient {
|
|
7
|
+
/** The conversation now. The same object until something in it changes, so it works with useSyncExternalStore. */
|
|
8
|
+
getState(): KnockChatConversation;
|
|
9
|
+
/** Calls `listener` once after each change. Returns a function that stops it. */
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
/** Sends a visitor message. False (nothing sent) when the text is empty after trimming, longer than 4,000 characters, or the status is 'unavailable'. */
|
|
12
|
+
send(text: string): boolean;
|
|
13
|
+
/** Sends a 'failed' visitor message again. */
|
|
14
|
+
retry(messageId: string): void;
|
|
15
|
+
/** Runs an action of an 'actions' part. Call it inside the visitor's click. */
|
|
16
|
+
resolveAction(actionId: string): void;
|
|
17
|
+
}
|
|
18
|
+
export interface KnockChatConversation {
|
|
19
|
+
/**
|
|
20
|
+
* 'connecting': the history is loading. 'reconnecting': the live stream dropped; messages still go and come.
|
|
21
|
+
* 'unavailable': the chat is off or blocked on this site. 'ready': everything else.
|
|
22
|
+
*/
|
|
23
|
+
status: 'ready' | 'connecting' | 'reconnecting' | 'unavailable';
|
|
24
|
+
messages: readonly KnockChatMessage[];
|
|
25
|
+
/** Who is typing: the agent or a rep. */
|
|
26
|
+
typing: KnockChatPerson | null;
|
|
27
|
+
/** Suggested first messages. Empty after the visitor's first message. */
|
|
28
|
+
starters: readonly string[];
|
|
29
|
+
/** Messages from the agent or a rep that arrived while your UI was closed. */
|
|
30
|
+
unread: number;
|
|
31
|
+
}
|
|
32
|
+
/** One run of parts from one author. A long reply can arrive as more than one message: group by author. */
|
|
33
|
+
export interface KnockChatMessage {
|
|
34
|
+
/** Stable. A visitor message keeps its id from 'sending' to 'sent'. */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Within one snapshot the same person is the same object: group messages with ===. */
|
|
37
|
+
author: KnockChatPerson;
|
|
38
|
+
/** Sent at, ms since epoch. */
|
|
39
|
+
at: number;
|
|
40
|
+
/** Render the part types you know and skip any other: later versions can add types. */
|
|
41
|
+
parts: readonly KnockChatPart[];
|
|
42
|
+
/** Visitor messages: 'sending' until Knock has it, 'failed' when it gave up (retry(id)). Every other message: 'sent'. */
|
|
43
|
+
status: 'sending' | 'sent' | 'failed';
|
|
44
|
+
/** A rep edited it. */
|
|
45
|
+
edited: boolean;
|
|
46
|
+
}
|
|
47
|
+
export type KnockChatPart =
|
|
48
|
+
/** Markdown for the agent and reps, plain text for the visitor. Never insert it as raw HTML. */
|
|
49
|
+
{
|
|
50
|
+
type: 'text';
|
|
51
|
+
text: string;
|
|
52
|
+
}
|
|
53
|
+
/** An http(s) URL. */
|
|
54
|
+
| {
|
|
55
|
+
type: 'image';
|
|
56
|
+
url: string;
|
|
57
|
+
alt: string;
|
|
58
|
+
} | {
|
|
59
|
+
type: 'actions';
|
|
60
|
+
actions: readonly KnockChatAction[];
|
|
61
|
+
}
|
|
62
|
+
/** The author, a rep, joined the conversation here. */
|
|
63
|
+
| {
|
|
64
|
+
type: 'joined';
|
|
65
|
+
};
|
|
66
|
+
export interface KnockChatAction {
|
|
67
|
+
id: string;
|
|
68
|
+
label: string;
|
|
69
|
+
primary: boolean;
|
|
70
|
+
/** What the action does: 'book-a-meeting' today. Draw a kind you do not know as a plain button. */
|
|
71
|
+
kind: string;
|
|
72
|
+
}
|
|
73
|
+
export interface KnockChatPerson {
|
|
74
|
+
kind: 'visitor' | 'agent' | 'rep';
|
|
75
|
+
/** The agent's or the rep's name. null for the visitor. */
|
|
76
|
+
name: string | null;
|
|
77
|
+
imageUrl: string | null;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=chat-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-types.d.ts","sourceRoot":"","sources":["../../../src/core/chat-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,kHAAkH;IAClH,QAAQ,IAAI,qBAAqB,CAAC;IAClC,iFAAiF;IACjF,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,yJAAyJ;IACzJ,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+EAA+E;IAC/E,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,CAAC;IAChE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC,yCAAyC;IACzC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,yEAAyE;IACzE,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2GAA2G;AAC3G,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,uFAAuF;IACvF,MAAM,EAAE,eAAe,CAAC;IACxB,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,uFAAuF;IACvF,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,yHAAyH;IACzH,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACtC,uBAAuB;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,aAAa;AACvB,gGAAgG;AAC9F;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAChC,sBAAsB;GACpB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE;AAC1D,uDAAuD;GACrD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,mGAAmG;IACnG,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;IAClC,2DAA2D;IAC3D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Runtime implementers' entry: the `window.Knock` contract (types) plus the wire protocol (types + policy constants). */
|
|
2
|
-
export type { KnockEventMap, KnockEventName, KnockFieldValue, KnockModalOpenOptions, KnockRuntime, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.cjs';
|
|
2
|
+
export type { KnockChat, KnockChatColors, KnockChatOpenEvent, KnockChatOpenOptions, KnockChatOptions, KnockChatPreset, KnockChatScreens, KnockChatSkin, KnockChatTestScenario, KnockEventMap, KnockEventName, KnockFieldValue, KnockModalOpenOptions, KnockRuntime, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.cjs';
|
|
3
3
|
export type { KnockWireBatch, KnockWireEvent } from './wire.cjs';
|
|
4
4
|
export { WIRE_BATCH_POLICY, WIRE_COMPRESSION, WIRE_EVENT_NAME_PATTERN, WIRE_RETRY_POLICY } from './wire.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Runtime implementers' entry: the `window.Knock` contract (types) plus the wire protocol (types + policy constants). */
|
|
2
|
-
export type { KnockEventMap, KnockEventName, KnockFieldValue, KnockModalOpenOptions, KnockRuntime, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.js';
|
|
2
|
+
export type { KnockChat, KnockChatColors, KnockChatOpenEvent, KnockChatOpenOptions, KnockChatOptions, KnockChatPreset, KnockChatScreens, KnockChatSkin, KnockChatTestScenario, KnockEventMap, KnockEventName, KnockFieldValue, KnockModalOpenOptions, KnockRuntime, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.js';
|
|
3
3
|
export type { KnockWireBatch, KnockWireEvent } from './wire.js';
|
|
4
4
|
export { WIRE_BATCH_POLICY, WIRE_COMPRESSION, WIRE_EVENT_NAME_PATTERN, WIRE_RETRY_POLICY } from './wire.js';
|
|
5
5
|
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/core/contract.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,YAAY,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/core/contract.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,YAAY,EACV,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -3,6 +3,5 @@ export declare class Emitter<EventMap extends object> {
|
|
|
3
3
|
private readonly handlers;
|
|
4
4
|
on<E extends keyof EventMap>(event: E, handler: (payload: EventMap[E]) => void): () => void;
|
|
5
5
|
emit<E extends keyof EventMap>(event: E, payload: EventMap[E]): void;
|
|
6
|
-
clear(): void;
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=emitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../src/core/emitter.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,qBAAa,OAAO,CAAC,QAAQ,SAAS,MAAM;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;IAErE,EAAE,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAW1F;IAED,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAInE;
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../../src/core/emitter.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,qBAAa,OAAO,CAAC,QAAQ,SAAS,MAAM;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;IAErE,EAAE,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAW1F;IAED,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAInE;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KnockSDK } from './types.cjs';
|
|
2
|
-
export type { KnockEnvironment, KnockEventMap, KnockEventName, KnockFieldValue, KnockIdentifyTraits, KnockInitOptions, KnockModalOpenOptions, KnockRuntime, KnockSDK, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.cjs';
|
|
2
|
+
export type { KnockChat, KnockChatColors, KnockChatOpenEvent, KnockChatOpenOptions, KnockChatOptions, KnockChatPreset, KnockChatScreens, KnockChatSkin, KnockChatTestScenario, KnockEnvironment, KnockEventMap, KnockEventName, KnockFieldValue, KnockIdentifyTraits, KnockInitOptions, KnockModalOpenOptions, KnockRuntime, KnockSDK, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.cjs';
|
|
3
|
+
export type { KnockChatAction, KnockChatClient, KnockChatConversation, KnockChatMessage, KnockChatPart, KnockChatPerson, } from './chat-types.cjs';
|
|
3
4
|
export { VERSION } from './version.cjs';
|
|
4
5
|
/**
|
|
5
6
|
* Builds one independent KnockSDK instance: its own queue, emitter and ready
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KnockSDK } from './types.js';
|
|
2
|
-
export type { KnockEnvironment, KnockEventMap, KnockEventName, KnockFieldValue, KnockIdentifyTraits, KnockInitOptions, KnockModalOpenOptions, KnockRuntime, KnockSDK, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.js';
|
|
2
|
+
export type { KnockChat, KnockChatColors, KnockChatOpenEvent, KnockChatOpenOptions, KnockChatOptions, KnockChatPreset, KnockChatScreens, KnockChatSkin, KnockChatTestScenario, KnockEnvironment, KnockEventMap, KnockEventName, KnockFieldValue, KnockIdentifyTraits, KnockInitOptions, KnockModalOpenOptions, KnockRuntime, KnockSDK, KnockSchedulingHandle, KnockSchedulingLoadOptions, KnockSchedulingStatus, KnockSchedulingStatusChange, KnockSdkBootConfig, KnockTagSurface, } from './types.js';
|
|
3
|
+
export type { KnockChatAction, KnockChatClient, KnockChatConversation, KnockChatMessage, KnockChatPart, KnockChatPerson, } from './chat-types.js';
|
|
3
4
|
export { VERSION } from './version.js';
|
|
4
5
|
/**
|
|
5
6
|
* Builds one independent KnockSDK instance: its own queue, emitter and ready
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,QAAQ,EAIT,MAAM,YAAY,CAAC;AAOpB,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,QAAQ,EACR,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,QAAQ,EAIT,MAAM,YAAY,CAAC;AAOpB,YAAY,EACV,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,QAAQ,EACR,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAUvC;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CA6LtC;AAKD;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,QAGlB,CAAC;eAEY,KAAK;AAEpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAEpE"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { KnockEnvironment, KnockSdkBootConfig } from './types.cjs';
|
|
2
|
-
/**
|
|
3
|
-
export declare function
|
|
2
|
+
/** The Knock runtime <script> already in the DOM (booted or still loading), if any. */
|
|
3
|
+
export declare function runtimeScript(): HTMLScriptElement | undefined;
|
|
4
4
|
/** tagIds of Knock tags that already booted on this page (the Knock tag's own duplicate guard). */
|
|
5
5
|
export declare function bootedTagIds(): string[];
|
|
6
6
|
export declare function buildScriptUrl(environment: KnockEnvironment, tagId: string, scriptUrl?: string): string;
|
|
7
7
|
/** Informational; the current Knock tag doesn't read it. */
|
|
8
8
|
export declare function writeBootConfig(config: KnockSdkBootConfig): void;
|
|
9
|
-
|
|
9
|
+
/** Adds the runtime <script>, unless one is already there. Returns the one on the page, so init can hear it fail. */
|
|
10
|
+
export declare function injectRuntimeScript(url: string): HTMLScriptElement | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { KnockEnvironment, KnockSdkBootConfig } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
export declare function
|
|
2
|
+
/** The Knock runtime <script> already in the DOM (booted or still loading), if any. */
|
|
3
|
+
export declare function runtimeScript(): HTMLScriptElement | undefined;
|
|
4
4
|
/** tagIds of Knock tags that already booted on this page (the Knock tag's own duplicate guard). */
|
|
5
5
|
export declare function bootedTagIds(): string[];
|
|
6
6
|
export declare function buildScriptUrl(environment: KnockEnvironment, tagId: string, scriptUrl?: string): string;
|
|
7
7
|
/** Informational; the current Knock tag doesn't read it. */
|
|
8
8
|
export declare function writeBootConfig(config: KnockSdkBootConfig): void;
|
|
9
|
-
|
|
9
|
+
/** Adds the runtime <script>, unless one is already there. Returns the one on the page, so init can hear it fail. */
|
|
10
|
+
export declare function injectRuntimeScript(url: string): HTMLScriptElement | undefined;
|
|
10
11
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAOvE,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAOvE,uFAAuF;AACvF,wBAAgB,aAAa,IAAI,iBAAiB,GAAG,SAAS,CAE7D;AAED,mGAAmG;AACnG,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED,wBAAgB,cAAc,CAC5B,WAAW,EAAE,gBAAgB,EAC7B,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAGR;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAGhE;AAED,qHAAqH;AACrH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAS9E"}
|
|
@@ -6,8 +6,8 @@ import type { KnockSchedulingHandle } from './types.cjs';
|
|
|
6
6
|
export interface DeferredSchedulingHandle extends KnockSchedulingHandle {
|
|
7
7
|
attach(real: KnockSchedulingHandle): void;
|
|
8
8
|
}
|
|
9
|
-
/** Dotted path into `window.Knock` (`identify`, `modal.open`, `widget.show`, …). */
|
|
10
|
-
export type RuntimePath = 'identify' | 'track' | 'modal.open' | 'modal.close' | 'scheduling.load' | 'widget.show' | 'widget.hide' | 'widget.open' | 'widget.close';
|
|
9
|
+
/** Dotted path into `window.Knock` (`identify`, `modal.open`, `widget.show`, …). `wrapLink` is only ever live, never queued. */
|
|
10
|
+
export type RuntimePath = 'identify' | 'track' | 'modal.open' | 'modal.close' | 'scheduling.load' | 'widget.show' | 'widget.hide' | 'widget.open' | 'widget.close' | 'chat.open' | 'chat.close' | 'chat.setSkin' | 'chat.resetSkin' | 'chat.configure' | 'wrapLink';
|
|
11
11
|
export interface QueuedCommand {
|
|
12
12
|
path: RuntimePath;
|
|
13
13
|
args: unknown[];
|
|
@@ -6,8 +6,8 @@ import type { KnockSchedulingHandle } from './types.js';
|
|
|
6
6
|
export interface DeferredSchedulingHandle extends KnockSchedulingHandle {
|
|
7
7
|
attach(real: KnockSchedulingHandle): void;
|
|
8
8
|
}
|
|
9
|
-
/** Dotted path into `window.Knock` (`identify`, `modal.open`, `widget.show`, …). */
|
|
10
|
-
export type RuntimePath = 'identify' | 'track' | 'modal.open' | 'modal.close' | 'scheduling.load' | 'widget.show' | 'widget.hide' | 'widget.open' | 'widget.close';
|
|
9
|
+
/** Dotted path into `window.Knock` (`identify`, `modal.open`, `widget.show`, …). `wrapLink` is only ever live, never queued. */
|
|
10
|
+
export type RuntimePath = 'identify' | 'track' | 'modal.open' | 'modal.close' | 'scheduling.load' | 'widget.show' | 'widget.hide' | 'widget.open' | 'widget.close' | 'chat.open' | 'chat.close' | 'chat.setSkin' | 'chat.resetSkin' | 'chat.configure' | 'wrapLink';
|
|
11
11
|
export interface QueuedCommand {
|
|
12
12
|
path: RuntimePath;
|
|
13
13
|
args: unknown[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/core/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC3C;AAED,
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/core/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC3C;AAED,gIAAgI;AAChI,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,OAAO,GACP,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,aAAa,GACb,cAAc,GACd,WAAW,GACX,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,sEAAsE;IACtE,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Keep this file dependency-free and DOM-agnostic: it is shared by the core and
|
|
5
5
|
* every framework binding.
|
|
6
6
|
*/
|
|
7
|
+
import type { KnockChatClient } from './chat-types.cjs';
|
|
7
8
|
export type KnockEnvironment = 'production' | 'staging' | 'development';
|
|
8
9
|
/** Which of the vendor's two Knock tags is loaded: the website tag or the product tag. */
|
|
9
10
|
export type KnockTagSurface = 'website' | 'product';
|
|
@@ -18,6 +19,8 @@ export interface KnockInitOptions {
|
|
|
18
19
|
debug?: boolean;
|
|
19
20
|
/** Load the Knock tag from this URL instead of Knock's default location. */
|
|
20
21
|
scriptUrl?: string;
|
|
22
|
+
/** Sets up the Knock chat before it shows. The same as calling `knock.chat.configure()` first. */
|
|
23
|
+
chat?: KnockChatOptions;
|
|
21
24
|
}
|
|
22
25
|
export interface KnockIdentifyTraits {
|
|
23
26
|
email: string;
|
|
@@ -63,6 +66,182 @@ export interface KnockSchedulingHandle {
|
|
|
63
66
|
close(): void;
|
|
64
67
|
readonly status: KnockSchedulingStatus;
|
|
65
68
|
}
|
|
69
|
+
/** A scripted conversation for the chat's test mode. */
|
|
70
|
+
export type KnockChatTestScenario = 'default' | 'returning' | 'rep' | 'booking' | 'media' | 'edited' | 'send-fails' | 'rate-limited' | 'session-expired' | 'offline' | 'no-stream' | 'disabled' | 'origin-blocked' | 'captcha';
|
|
71
|
+
export interface KnockChatOpenOptions {
|
|
72
|
+
/** Opens this screen of the chat. */
|
|
73
|
+
screen?: string;
|
|
74
|
+
/** Pre-fills the message box. */
|
|
75
|
+
message?: string;
|
|
76
|
+
/** Sends this message for the visitor. Sent once per conversation. */
|
|
77
|
+
send?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Moves the chat to this magic link: it stays there for later `open()` calls until another link is
|
|
80
|
+
* set. Each link has its own conversation. In test mode it only names the scripted conversation.
|
|
81
|
+
*/
|
|
82
|
+
magicLinkId?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A click event from the DOM or a framework, so `onClick={knock.chat.open}` and `@click="knock.chat.open"`
|
|
86
|
+
* work as they are. The chat ignores it and opens as `open()` does.
|
|
87
|
+
*/
|
|
88
|
+
export interface KnockChatOpenEvent {
|
|
89
|
+
readonly type: string;
|
|
90
|
+
preventDefault(): void;
|
|
91
|
+
}
|
|
92
|
+
/** Names of the chat's built-in looks. Other names are passed through to the chat as they are. */
|
|
93
|
+
export type KnockChatPreset = 'harbor' | 'nightshift' | 'fieldbook' | 'signal' | 'terminal' | 'pixel';
|
|
94
|
+
type KnockChatSkinGroup = {
|
|
95
|
+
[key: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The chat's colours, each a hex colour like `'#2346D8'`. A key you set replaces the look's value;
|
|
99
|
+
* a key you leave out keeps the look's.
|
|
100
|
+
*/
|
|
101
|
+
export interface KnockChatColors {
|
|
102
|
+
/** Your main colour: buttons and, in most looks, the visitor's bubble and the launcher. */
|
|
103
|
+
brand?: string;
|
|
104
|
+
/** Text and icons on `brand`. */
|
|
105
|
+
onBrand?: string;
|
|
106
|
+
/** Links and brand-coloured text on the chat's surfaces. */
|
|
107
|
+
brandInk?: string;
|
|
108
|
+
/** The chat's background. */
|
|
109
|
+
bg?: string;
|
|
110
|
+
/** Menus, cards, chips and code blocks. */
|
|
111
|
+
surface?: string;
|
|
112
|
+
/** Hovered items, table headers and day stamps. */
|
|
113
|
+
surfaceRaised?: string;
|
|
114
|
+
/** The main text. */
|
|
115
|
+
text?: string;
|
|
116
|
+
/** Secondary text: times, hints and placeholders. */
|
|
117
|
+
textMuted?: string;
|
|
118
|
+
/** Borders and dividers. Their width is `shape.borderWidth`. */
|
|
119
|
+
border?: string;
|
|
120
|
+
/** The visitor's bubble. */
|
|
121
|
+
userBubble?: string;
|
|
122
|
+
/** Text in the visitor's bubble. */
|
|
123
|
+
userBubbleText?: string;
|
|
124
|
+
/** The agent's bubble. */
|
|
125
|
+
agentBubble?: string;
|
|
126
|
+
/** Text in the agent's bubble. */
|
|
127
|
+
agentBubbleText?: string;
|
|
128
|
+
/** Unread badges and dots. */
|
|
129
|
+
accent?: string;
|
|
130
|
+
/** Text and icons on `accent`. */
|
|
131
|
+
onAccent?: string;
|
|
132
|
+
/** Success marks, such as a check or the live dot. */
|
|
133
|
+
positive?: string;
|
|
134
|
+
/** The keyboard focus outline. */
|
|
135
|
+
focusRing?: string;
|
|
136
|
+
/** The launcher bubble. */
|
|
137
|
+
launcherBg?: string;
|
|
138
|
+
/** The icon and label on the launcher bubble. */
|
|
139
|
+
launcherFg?: string;
|
|
140
|
+
/** The header's background. */
|
|
141
|
+
headerBg?: string;
|
|
142
|
+
/** Text and buttons in the header. */
|
|
143
|
+
headerFg?: string;
|
|
144
|
+
}
|
|
145
|
+
/** How the chat looks. Each key you set replaces that part of the look; the chat fills in the rest. */
|
|
146
|
+
export interface KnockChatSkin {
|
|
147
|
+
/** A built-in look to start from. A skin that names a preset drops the look set in your Knock tag. */
|
|
148
|
+
preset?: KnockChatPreset | (string & {});
|
|
149
|
+
mode?: 'light' | 'dark' | 'auto';
|
|
150
|
+
colors?: KnockChatColors;
|
|
151
|
+
/** The dark palette. `null` makes the chat derive one from `colors.brand`. */
|
|
152
|
+
colorsDark?: KnockChatColors | null;
|
|
153
|
+
/** The light palette of a dark look (`nightshift`), shown in light mode. */
|
|
154
|
+
colorsLight?: KnockChatColors | null;
|
|
155
|
+
typography?: KnockChatSkinGroup;
|
|
156
|
+
shape?: KnockChatSkinGroup;
|
|
157
|
+
layout?: KnockChatSkinGroup;
|
|
158
|
+
bubble?: KnockChatSkinGroup;
|
|
159
|
+
motion?: KnockChatSkinGroup;
|
|
160
|
+
direction?: 'ltr' | 'rtl';
|
|
161
|
+
responsive?: KnockChatSkinGroup;
|
|
162
|
+
/**
|
|
163
|
+
* Pictures by URL, one per place: each an `https://` or `http://` URL, or a path on your site.
|
|
164
|
+
* Anything else is ignored. Without one, or when it fails to load, the place shows what it shows
|
|
165
|
+
* with no picture. `null` clears it.
|
|
166
|
+
* - `bubble`: the bubble's picture, in place of its icon.
|
|
167
|
+
* - `wall`: the conversation's background, drawn as a soft pattern from the picture's shape. A
|
|
168
|
+
* picture from another origin needs CORS.
|
|
169
|
+
* - `header`: your logo, in the header in place of the agent's picture.
|
|
170
|
+
*/
|
|
171
|
+
assets?: {
|
|
172
|
+
bubble?: string | null;
|
|
173
|
+
wall?: string | null;
|
|
174
|
+
header?: string | null;
|
|
175
|
+
};
|
|
176
|
+
[key: string]: unknown;
|
|
177
|
+
}
|
|
178
|
+
/** The chat's screens: which one it starts on, how the visitor moves between them, and what each shows. */
|
|
179
|
+
export interface KnockChatScreens {
|
|
180
|
+
start?: string;
|
|
181
|
+
nav?: 'none' | 'menu' | 'tabs';
|
|
182
|
+
items?: Array<{
|
|
183
|
+
id: string;
|
|
184
|
+
[key: string]: unknown;
|
|
185
|
+
}>;
|
|
186
|
+
}
|
|
187
|
+
/** Each key you pass replaces that key; `skin: null` clears the look set from code. Keys you leave out stay as they are. */
|
|
188
|
+
export interface KnockChatOptions {
|
|
189
|
+
/** The look: colours, type, shape, layout, bubble, motion, direction and your pictures. */
|
|
190
|
+
skin?: KnockChatSkin | null;
|
|
191
|
+
/** What opens the chat: its bubble, your page's buttons, or both. Default `'both'`. */
|
|
192
|
+
launcher?: 'bubble' | 'buttons' | 'both';
|
|
193
|
+
screens?: KnockChatScreens;
|
|
194
|
+
/** Up to 4 suggested first messages. */
|
|
195
|
+
starters?: string[];
|
|
196
|
+
brandName?: string;
|
|
197
|
+
agentName?: string;
|
|
198
|
+
/**
|
|
199
|
+
* The AI agent's picture, in the header and beside its messages: an `https://` or `http://` URL, or
|
|
200
|
+
* a path on your site. Anything else is ignored. Without it, or when it fails to load, the agent
|
|
201
|
+
* shows the first letter of `brandName`, else the spark icon. `null` clears it.
|
|
202
|
+
*/
|
|
203
|
+
agentImageUrl?: string | null;
|
|
204
|
+
/**
|
|
205
|
+
* The magic link the chat runs on, instead of the one set in your Knock tag. Setting it moves the
|
|
206
|
+
* chat to that link, even after `open()` moved it to another one; `null` goes back to the tag's
|
|
207
|
+
* link. Each link has its own conversation. The link must belong to your workspace.
|
|
208
|
+
*/
|
|
209
|
+
magicLinkId?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* Test mode: the chat runs a scripted conversation instead of your live chat. `true` runs the
|
|
212
|
+
* `'default'` scenario. Once on, it stays on for the page; `false` doesn't turn it off.
|
|
213
|
+
*/
|
|
214
|
+
test?: boolean | KnockChatTestScenario;
|
|
215
|
+
/**
|
|
216
|
+
* Shows the chat inside this element of your page instead of floating over it. The chat fills the
|
|
217
|
+
* element and is always shown: no bubble and no close button, styled by your skin. Give the
|
|
218
|
+
* element a height. A string is a CSS selector. It is looked up when you set it and when the chat
|
|
219
|
+
* loads. Set `container` again to move the chat (after a route change, for example): the
|
|
220
|
+
* conversation stays. `null` goes back to the floating chat.
|
|
221
|
+
*/
|
|
222
|
+
container?: Element | string | null;
|
|
223
|
+
/**
|
|
224
|
+
* Your own chat UI. Knock renders nothing and downloads no UI (no React, no styles): only the
|
|
225
|
+
* conversation. Your function is called with the chat client when the chat has loaded. Set it
|
|
226
|
+
* before the chat loads, in `init({ chat })`; once on, it stays on for the page. `null` clears
|
|
227
|
+
* it before the chat loads.
|
|
228
|
+
*/
|
|
229
|
+
headless?: ((chat: KnockChatClient) => void) | null;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The Knock chat. When your Knock tag has the chat, the SDK uses it. When it has none, the SDK loads and runs the chat
|
|
233
|
+
* itself. A page never shows two chats.
|
|
234
|
+
*/
|
|
235
|
+
export interface KnockChat {
|
|
236
|
+
/** Opens the chat. Also takes a click event, so you can pass it straight to `onClick`. */
|
|
237
|
+
open(options?: KnockChatOpenOptions | KnockChatOpenEvent): void;
|
|
238
|
+
close(): void;
|
|
239
|
+
/** Replaces the look you set from code. */
|
|
240
|
+
setSkin(skin: KnockChatSkin): void;
|
|
241
|
+
/** Drops the look you set from code, back to your Knock tag's. */
|
|
242
|
+
resetSkin(): void;
|
|
243
|
+
configure(options: KnockChatOptions): void;
|
|
244
|
+
}
|
|
66
245
|
export interface KnockEventMap {
|
|
67
246
|
/** Fires once. A handler added after that still runs, once. */
|
|
68
247
|
ready: void;
|
|
@@ -75,6 +254,13 @@ export interface KnockEventMap {
|
|
|
75
254
|
};
|
|
76
255
|
'widget:open': void;
|
|
77
256
|
'widget:close': void;
|
|
257
|
+
/** `test` is true while the chat runs in test mode. */
|
|
258
|
+
'chat:open': {
|
|
259
|
+
test: boolean;
|
|
260
|
+
};
|
|
261
|
+
'chat:close': {
|
|
262
|
+
test: boolean;
|
|
263
|
+
};
|
|
78
264
|
error: {
|
|
79
265
|
message: string;
|
|
80
266
|
cause?: unknown;
|
|
@@ -98,7 +284,23 @@ export interface KnockSDK {
|
|
|
98
284
|
open(): void;
|
|
99
285
|
close(): void;
|
|
100
286
|
};
|
|
287
|
+
chat: KnockChat;
|
|
101
288
|
on<E extends KnockEventName>(event: E, handler: (payload: KnockEventMap[E]) => void): () => void;
|
|
289
|
+
/**
|
|
290
|
+
* Returns `url` with the visitor's Knock identity added, so a Knock chat opened from it knows who
|
|
291
|
+
* they are. Call it when the visitor opens the link (on click and middle-click), not when you
|
|
292
|
+
* render it, and put the plain URL back right after, so a copied link stays clean. Before your
|
|
293
|
+
* Knock tag is ready, on the server, or on a tag that predates it, it returns `url` unchanged.
|
|
294
|
+
* Synchronous; never throws, never queued. In React, `<KnockLink href={url}>` does all of this.
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* link.onclick = () => {
|
|
298
|
+
* link.href = knock.wrapLink(url);
|
|
299
|
+
* setTimeout(() => (link.href = url));
|
|
300
|
+
* };
|
|
301
|
+
* window.open(knock.wrapLink(url));
|
|
302
|
+
*/
|
|
303
|
+
wrapLink(url: string): string;
|
|
102
304
|
/** True once the runtime has loaded and drained the queue. */
|
|
103
305
|
readonly ready: boolean;
|
|
104
306
|
readonly version: string;
|
|
@@ -124,7 +326,15 @@ export interface KnockRuntime {
|
|
|
124
326
|
open(): void;
|
|
125
327
|
close(): void;
|
|
126
328
|
};
|
|
329
|
+
/** On a tag whose config turns the chat on, and on any tag after `loadChat()`. */
|
|
330
|
+
chat?: KnockChat;
|
|
331
|
+
/** Loads the tag's chat on a tag whose config has none: `chat` is there once it resolves. Absent on tags that predate it (0.10.0 and earlier). */
|
|
332
|
+
loadChat?(): Promise<KnockChat | undefined>;
|
|
127
333
|
on?<E extends KnockEventName>(event: E, handler: (payload: KnockEventMap[E]) => void): () => void;
|
|
334
|
+
/** `url` with the visitor's identity added. Absent on tags that predate it. */
|
|
335
|
+
wrapLink?(url: string): string;
|
|
336
|
+
/** The visitor's id. */
|
|
337
|
+
getUID?(): string;
|
|
128
338
|
}
|
|
129
339
|
/** What the SDK writes to `window.__KNOCK_SDK__` on `init()`. Informational; the current Knock tag doesn't read it. */
|
|
130
340
|
export interface KnockSdkBootConfig {
|
|
@@ -145,4 +355,8 @@ declare global {
|
|
|
145
355
|
initialized?: boolean;
|
|
146
356
|
}>;
|
|
147
357
|
}
|
|
358
|
+
/** The DOM's own `Element`. Named here so these types also compile without the DOM lib. */
|
|
359
|
+
interface Element {
|
|
360
|
+
}
|
|
148
361
|
}
|
|
362
|
+
export {};
|