-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconsts.ts
More file actions
50 lines (44 loc) · 1.8 KB
/
consts.ts
File metadata and controls
50 lines (44 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export const DATASTAR = "datastar" as const;
export const DATASTAR_REQUEST = "Datastar-Request";
export const VERSION = "1.0.0-RC.4";
// The default duration for retrying SSE on connection reset. This is part of the underlying retry mechanism of SSE.
export const DefaultSseRetryDurationMs = 1000;
// Should elements be patched using the ViewTransition API?
export const DefaultElementsUseViewTransitions = false;
// Should a given set of signals patch if they are missing?
export const DefaultPatchSignalsOnlyIfMissing = false;
export const DatastarDatalineSelector = "selector"
export const DatastarDatalinePatchMode = "mode"
export const DatastarDatalineElements = "elements"
export const DatastarDatalineUseViewTransition = "useViewTransition"
export const DatastarDatalineSignals = "signals"
export const DatastarDatalineOnlyIfMissing = "onlyIfMissing"
export const DatastarDatalinePaths = "paths"
// The mode in which an element is patched into the DOM.
export const ElementPatchModes = [
// Morph entire element, preserving state
"outer",
// Morph inner HTML only, preserving state
"inner",
// Replace entire element, reset state
"replace",
// Insert at beginning inside target
"prepend",
// Insert at end inside target
"append",
// Insert before target element
"before",
// Insert after target element
"after",
// Remove target element from DOM
"remove",
] as const;
// Default value for ElementPatchMode
export const DefaultElementPatchMode = "outer";
// The type protocol on top of SSE which allows for core pushed based communication between the server and the client.
export const EventTypes = [
// An event for patching HTML elements into the DOM.
"datastar-patch-elements",
// An event for patching signals.
"datastar-patch-signals",
] as const;