@forinda/kickjs-view 0.6.0 → 0.7.0
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/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/edge.d.ts +4 -5
- package/dist/edge.js +2 -2
- package/dist/{exports-BsyGvnEU.js → exports-CII2eM6o.js} +4 -4
- package/dist/exports-CII2eM6o.js.map +1 -0
- package/dist/{types-D-OIrXCW.d.ts → file-BIua9gOB.d.ts} +676 -105
- package/dist/file-BIua9gOB.d.ts.map +1 -0
- package/dist/file-loader.d.ts +2 -2
- package/dist/file-loader.js +3 -3
- package/dist/file-loader.js.map +1 -1
- package/dist/{format-DBjtuDUY.js → format-CvHG95ck.js} +3 -3
- package/dist/{format-DBjtuDUY.js.map → format-CvHG95ck.js.map} +1 -1
- package/dist/i18n-EriU9b68.js +12 -0
- package/dist/i18n-EriU9b68.js.map +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{project-DeGFHgGJ.d.ts → project-mP4NzZhQ.d.ts} +4 -2
- package/dist/project-mP4NzZhQ.d.ts.map +1 -0
- package/dist/{serve-Hc5UlJ56.d.ts → serve-Df9_MrXE.d.ts} +11 -12
- package/dist/serve-Df9_MrXE.d.ts.map +1 -0
- package/dist/{summary-EefMyOjo.js → summary-DOhWOKmu.js} +6 -6
- package/dist/summary-DOhWOKmu.js.map +1 -0
- package/package.json +5 -3
- package/virtual.d.ts +4 -1
- package/dist/ast-Pq3XT2Xi.d.ts +0 -527
- package/dist/ast-Pq3XT2Xi.d.ts.map +0 -1
- package/dist/exports-BsyGvnEU.js.map +0 -1
- package/dist/project-DeGFHgGJ.d.ts.map +0 -1
- package/dist/project-XTTCeVf3.js +0 -12
- package/dist/project-XTTCeVf3.js.map +0 -1
- package/dist/serve-Hc5UlJ56.d.ts.map +0 -1
- package/dist/summary-EefMyOjo.js.map +0 -1
- package/dist/types-D-OIrXCW.d.ts.map +0 -1
|
@@ -1,18 +1,650 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Message catalogues for the `t` pipe: `<viewsDir>/locales/<locale>.json`,
|
|
4
|
+
* nested keys addressed with dots, plural forms picked by `Intl.PluralRules`.
|
|
5
|
+
*
|
|
6
|
+
* ```json
|
|
7
|
+
* { "cart": { "title": "Cart", "items": { "one": "{count} item", "other": "{count} items" } } }
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
declare const PLURAL_FORMS: readonly ['zero', 'one', 'two', 'few', 'many', 'other'];
|
|
11
|
+
type PluralForm = (typeof PLURAL_FORMS)[number];
|
|
12
|
+
/** A message: text, or one text per plural form (`other` required). */
|
|
13
|
+
type Message = string | ({
|
|
14
|
+
other: string;
|
|
15
|
+
} & Partial<Record<Exclude<PluralForm, 'other'>, string>>);
|
|
16
|
+
/** Locale → dot key → message. */
|
|
17
|
+
type Messages = Record<string, Record<string, Message>>;
|
|
18
|
+
/** What the check knows of the catalogues: each key's locales and placeholders. */
|
|
19
|
+
interface CatalogIndex {
|
|
20
|
+
/** The catalogue folder, as messages name it (`src/views/locales`). */
|
|
21
|
+
where: string;
|
|
22
|
+
locales: string[];
|
|
23
|
+
keys: Map<string, {
|
|
24
|
+
locales: Set<string>;
|
|
25
|
+
params: Set<string>;
|
|
26
|
+
}>;
|
|
5
27
|
}
|
|
6
|
-
|
|
7
|
-
|
|
28
|
+
/** The catalogues indexed for checking `t` calls. */
|
|
29
|
+
declare function catalogIndex(messages: Messages, where: string): CatalogIndex;
|
|
30
|
+
/** A point in a template: 0-based offset, 1-based line and column (UTF-16 units). */
|
|
31
|
+
interface Pos {
|
|
32
|
+
offset: number;
|
|
33
|
+
line: number;
|
|
34
|
+
column: number;
|
|
35
|
+
}
|
|
36
|
+
/** A source range in a template, start and end. */
|
|
37
|
+
interface Span {
|
|
38
|
+
start: Pos;
|
|
39
|
+
end: Pos;
|
|
40
|
+
}
|
|
41
|
+
/** An error or warning from parsing, checking or rendering a template. */
|
|
42
|
+
interface Diagnostic {
|
|
43
|
+
file: string;
|
|
44
|
+
span: Span;
|
|
45
|
+
message: string;
|
|
46
|
+
severity: 'error' | 'warning';
|
|
47
|
+
/** The templates being rendered, outermost first, when the error came from a render. */
|
|
48
|
+
stack?: string[];
|
|
49
|
+
}
|
|
50
|
+
/** The position of `offset` in `source`. */
|
|
51
|
+
declare const positionAt: (source: string, offset: number) => Pos;
|
|
52
|
+
/** Bumped when the shape of a checked template changes; builds and runtimes must agree. */
|
|
53
|
+
declare const AST_FORMAT_VERSION = 3;
|
|
54
|
+
/** A literal value in a template expression. */
|
|
55
|
+
type Literal = string | number | boolean | null;
|
|
56
|
+
/** One step of a path expression: `.name`, `[expr]`, or their `?.` forms. */
|
|
57
|
+
interface PathSegment {
|
|
58
|
+
/** `.name` / `?.name` */
|
|
59
|
+
name?: string;
|
|
60
|
+
/** `[expr]` / `?.[expr]` */
|
|
61
|
+
computed?: Expr;
|
|
62
|
+
optional: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** A parsed template expression. */
|
|
65
|
+
type Expr = {
|
|
66
|
+
kind: 'literal';
|
|
67
|
+
value: Literal;
|
|
68
|
+
span: Span;
|
|
69
|
+
} | {
|
|
70
|
+
kind: 'path';
|
|
71
|
+
root: string;
|
|
72
|
+
segments: PathSegment[];
|
|
73
|
+
span: Span;
|
|
74
|
+
} | {
|
|
75
|
+
kind: 'unary';
|
|
76
|
+
op: '!' | '-';
|
|
77
|
+
arg: Expr;
|
|
78
|
+
span: Span;
|
|
79
|
+
} | {
|
|
80
|
+
kind: 'binary';
|
|
81
|
+
op: '+' | '-' | '<' | '>' | '<=' | '>=' | '==' | '!=' | '===' | '!==';
|
|
82
|
+
left: Expr;
|
|
83
|
+
right: Expr;
|
|
84
|
+
span: Span;
|
|
85
|
+
} | {
|
|
86
|
+
kind: 'logical';
|
|
87
|
+
op: '&&' | '||' | '??';
|
|
88
|
+
left: Expr;
|
|
89
|
+
right: Expr;
|
|
90
|
+
span: Span;
|
|
91
|
+
} | {
|
|
92
|
+
kind: 'conditional';
|
|
93
|
+
test: Expr;
|
|
94
|
+
whenTrue: Expr;
|
|
95
|
+
whenFalse: Expr;
|
|
96
|
+
span: Span;
|
|
97
|
+
} | {
|
|
98
|
+
kind: 'pipe';
|
|
99
|
+
input: Expr;
|
|
100
|
+
name: string;
|
|
101
|
+
args: Expr[];
|
|
102
|
+
span: Span;
|
|
103
|
+
};
|
|
104
|
+
/** Where an interpolation lands, which decides how its value is escaped. */
|
|
105
|
+
type Ctx = 'text' | 'rcdata' | 'raw-text' | 'comment';
|
|
106
|
+
/** A parsed element attribute. */
|
|
107
|
+
interface Attr {
|
|
108
|
+
/** As written: `href`, `userId` (from `[userId]`), `on` (from `[class.on]`). */
|
|
109
|
+
name: string;
|
|
110
|
+
/**
|
|
111
|
+
* `static` `a="x"`, `interp` `a="x{{ y }}"`, `bare` `a`, `bind` `[a]="expr"`,
|
|
112
|
+
* `class` `[class.a]="expr"`, `style` `[style.a(.unit)]="expr"`.
|
|
113
|
+
*/
|
|
114
|
+
kind: 'static' | 'interp' | 'bare' | 'bind' | 'class' | 'style';
|
|
115
|
+
/** `static` / `interp`: the value, literal text and expressions in order. */
|
|
116
|
+
parts?: Array<string | Expr>;
|
|
117
|
+
/** `bind` / `class` / `style`: the bound expression. */
|
|
118
|
+
expr?: Expr;
|
|
119
|
+
/** `[style.width.px]`: `px`. */
|
|
120
|
+
unit?: string;
|
|
121
|
+
quoted: boolean;
|
|
122
|
+
span: Span;
|
|
123
|
+
}
|
|
124
|
+
/** A parsed HTML element. */
|
|
125
|
+
interface Element {
|
|
126
|
+
k: 'element';
|
|
127
|
+
/** As written. */
|
|
128
|
+
tag: string;
|
|
129
|
+
attrs: Attr[];
|
|
130
|
+
children: Node[];
|
|
131
|
+
/** Inside `<svg>` / `<math>`: names keep their case. */
|
|
132
|
+
foreign: boolean;
|
|
133
|
+
void: boolean;
|
|
134
|
+
selfClosing: boolean;
|
|
135
|
+
span: Span;
|
|
136
|
+
}
|
|
137
|
+
/** One branch of an `@if` / `@else if` / `@else` chain. */
|
|
138
|
+
interface IfBranch {
|
|
139
|
+
/** Absent on `@else`. */
|
|
140
|
+
cond?: Expr;
|
|
141
|
+
/** `@if (x; as y)` */
|
|
142
|
+
alias?: string;
|
|
143
|
+
body: Node[];
|
|
144
|
+
}
|
|
145
|
+
/** A loop variable an `@for` can bind with `let`. */
|
|
146
|
+
type LoopVar = '$index' | '$first' | '$last' | '$even' | '$odd' | '$count';
|
|
147
|
+
/** A parsed template node. */
|
|
148
|
+
type Node = {
|
|
149
|
+
k: 'text';
|
|
150
|
+
value: string;
|
|
151
|
+
span: Span;
|
|
152
|
+
} | {
|
|
153
|
+
k: 'interp';
|
|
154
|
+
expr: Expr;
|
|
155
|
+
ctx: Ctx;
|
|
156
|
+
span: Span;
|
|
157
|
+
} | Element | {
|
|
158
|
+
k: 'comment';
|
|
159
|
+
children: Node[];
|
|
160
|
+
span: Span;
|
|
161
|
+
} | {
|
|
162
|
+
k: 'if';
|
|
163
|
+
branches: IfBranch[];
|
|
164
|
+
span: Span;
|
|
165
|
+
} | {
|
|
166
|
+
k: 'for';
|
|
167
|
+
item: string | [string, string];
|
|
168
|
+
of: Expr;
|
|
169
|
+
lets: Record<string, LoopVar>;
|
|
170
|
+
body: Node[];
|
|
171
|
+
empty?: Node[];
|
|
172
|
+
span: Span;
|
|
173
|
+
} | {
|
|
174
|
+
k: 'switch';
|
|
175
|
+
on: Expr;
|
|
176
|
+
cases: Array<{
|
|
177
|
+
value: Expr;
|
|
178
|
+
body: Node[];
|
|
179
|
+
}>;
|
|
180
|
+
default?: Node[];
|
|
181
|
+
span: Span;
|
|
182
|
+
} | {
|
|
183
|
+
k: 'let';
|
|
184
|
+
name: string;
|
|
185
|
+
expr: Expr;
|
|
186
|
+
span: Span;
|
|
187
|
+
} | {
|
|
188
|
+
k: 'verbatim';
|
|
189
|
+
text: string;
|
|
190
|
+
span: Span;
|
|
191
|
+
} |
|
|
192
|
+
/** `<slot name="n" [x]="expr">`: the values (`offers`) it hands the caller's content */
|
|
193
|
+
{
|
|
194
|
+
k: 'slot-outlet';
|
|
195
|
+
name?: string;
|
|
196
|
+
offers: Array<{
|
|
197
|
+
name: string;
|
|
198
|
+
expr: Expr;
|
|
199
|
+
span: Span;
|
|
200
|
+
}>;
|
|
201
|
+
fallback: Node[];
|
|
202
|
+
span: Span;
|
|
203
|
+
} |
|
|
204
|
+
/** `@slot('n'; let a, b = c) { }`: `lets` bind offered values (`from`) to names */
|
|
205
|
+
{
|
|
206
|
+
k: 'slot-fill';
|
|
207
|
+
name: string;
|
|
208
|
+
lets: Array<{
|
|
209
|
+
name: string;
|
|
210
|
+
from: string;
|
|
211
|
+
}>;
|
|
212
|
+
body: Node[];
|
|
213
|
+
span: Span;
|
|
214
|
+
} | {
|
|
215
|
+
k: 'assets';
|
|
216
|
+
entry: string;
|
|
217
|
+
span: Span;
|
|
218
|
+
} |
|
|
219
|
+
/** `@fragment('name') { }`: a block a render can ask for on its own */
|
|
220
|
+
{
|
|
221
|
+
k: 'fragment';
|
|
222
|
+
name: string;
|
|
223
|
+
body: Node[];
|
|
224
|
+
span: Span;
|
|
225
|
+
} |
|
|
226
|
+
/** `@push('name') { }`: content for a layout's `<stack name>` */
|
|
227
|
+
{
|
|
228
|
+
k: 'push';
|
|
229
|
+
name: string;
|
|
230
|
+
body: Node[];
|
|
231
|
+
span: Span;
|
|
232
|
+
} |
|
|
233
|
+
/** `@snippet name(a, b = 'x') { }`: a block of markup with parameters, top level only */
|
|
234
|
+
{
|
|
235
|
+
k: 'snippet';
|
|
236
|
+
name: string;
|
|
237
|
+
params: Array<{
|
|
238
|
+
name: string;
|
|
239
|
+
default?: Literal;
|
|
240
|
+
}>;
|
|
241
|
+
body: Node[];
|
|
242
|
+
span: Span;
|
|
243
|
+
} |
|
|
244
|
+
/** `@render name(args)`: run a snippet of this file */
|
|
245
|
+
{
|
|
246
|
+
k: 'render';
|
|
247
|
+
name: string;
|
|
248
|
+
args: Expr[];
|
|
249
|
+
span: Span;
|
|
250
|
+
} |
|
|
251
|
+
/** `<stack name="…" />`: where pushed content goes; `children` must be blank (checked) */
|
|
252
|
+
{
|
|
253
|
+
k: 'stack';
|
|
254
|
+
name: string;
|
|
255
|
+
children: Node[];
|
|
256
|
+
span: Span;
|
|
257
|
+
};
|
|
258
|
+
/** An `@input` declaration, with its default when given. */
|
|
259
|
+
interface InputDecl {
|
|
260
|
+
name: string;
|
|
261
|
+
/** `@input name: Type`: the TypeScript type, as written (typegen copies it) */
|
|
262
|
+
type?: string;
|
|
263
|
+
default?: {
|
|
264
|
+
value: Literal;
|
|
265
|
+
span: Span;
|
|
266
|
+
};
|
|
267
|
+
span: Span;
|
|
268
|
+
}
|
|
269
|
+
/** A parsed template: its layout, inputs and body. */
|
|
270
|
+
interface TemplateAst {
|
|
271
|
+
file: string;
|
|
272
|
+
/** `undefined`: none declared (the default layout applies); `null`: `@layout(none)`. */
|
|
273
|
+
layout?: string | null;
|
|
274
|
+
layoutSpan?: Span;
|
|
275
|
+
inputs: InputDecl[];
|
|
276
|
+
/** `@import type … from '…'` lines, as written without the `@` (typegen copies them) */
|
|
277
|
+
typeImports?: string[];
|
|
278
|
+
body: Node[];
|
|
279
|
+
}
|
|
280
|
+
/** `[line, column]` of a node in its template, for render errors. */
|
|
281
|
+
type At = [number, number];
|
|
282
|
+
/** A path segment: `.n` or `[e]`; `o` marks `?.`. */
|
|
283
|
+
type CSeg = {
|
|
284
|
+
n: string;
|
|
285
|
+
o?: 1;
|
|
286
|
+
} | {
|
|
287
|
+
e: CExpr;
|
|
288
|
+
o?: 1;
|
|
289
|
+
};
|
|
290
|
+
/** A checked expression, as the renderer reads it. */
|
|
291
|
+
type CExpr =
|
|
292
|
+
/** literal */
|
|
293
|
+
{
|
|
294
|
+
k: 'l';
|
|
295
|
+
v: Literal;
|
|
296
|
+
} |
|
|
297
|
+
/** undefined (a name a component doesn't have) */
|
|
298
|
+
{
|
|
299
|
+
k: 'x';
|
|
300
|
+
} |
|
|
301
|
+
/** page / shared data: `n` then the path */
|
|
302
|
+
{
|
|
303
|
+
k: 'd';
|
|
304
|
+
n: string;
|
|
305
|
+
p: CSeg[];
|
|
306
|
+
} |
|
|
307
|
+
/** a scope slot (@let, loop item, @if alias, component input) then the path */
|
|
308
|
+
{
|
|
309
|
+
k: 'v';
|
|
310
|
+
s: number;
|
|
311
|
+
p: CSeg[];
|
|
312
|
+
} |
|
|
313
|
+
/** a loop variable of the loop whose meta is in slot `s` */
|
|
314
|
+
{
|
|
315
|
+
k: 'm';
|
|
316
|
+
s: number;
|
|
317
|
+
w: LoopVar;
|
|
318
|
+
} | {
|
|
319
|
+
k: 'u';
|
|
320
|
+
o: '!' | '-';
|
|
321
|
+
a: CExpr;
|
|
322
|
+
} | {
|
|
323
|
+
k: 'b';
|
|
324
|
+
o: string;
|
|
325
|
+
l: CExpr;
|
|
326
|
+
r: CExpr;
|
|
327
|
+
} | {
|
|
328
|
+
k: 'c';
|
|
329
|
+
t: CExpr;
|
|
330
|
+
y: CExpr;
|
|
331
|
+
n: CExpr;
|
|
332
|
+
} | {
|
|
333
|
+
k: 'p';
|
|
334
|
+
n: string;
|
|
335
|
+
i: CExpr;
|
|
336
|
+
a: CExpr[];
|
|
337
|
+
};
|
|
338
|
+
/** One attribute of an element whose attributes need work at render time. */
|
|
339
|
+
type CAttr =
|
|
340
|
+
/** static; `v: true` is a bare attribute */
|
|
341
|
+
{
|
|
342
|
+
t: 's';
|
|
343
|
+
n: string;
|
|
344
|
+
v: string | true;
|
|
345
|
+
} |
|
|
346
|
+
/** `n="text {{ e }}"`; `u` marks a URL attribute (`srcset` checks each candidate) */
|
|
347
|
+
{
|
|
348
|
+
t: 'i';
|
|
349
|
+
n: string;
|
|
350
|
+
p: Array<string | CExpr>;
|
|
351
|
+
u?: 'url' | 'srcset';
|
|
352
|
+
} |
|
|
353
|
+
/** `[n]="e"` */
|
|
354
|
+
{
|
|
355
|
+
t: 'b';
|
|
356
|
+
n: string;
|
|
357
|
+
e: CExpr;
|
|
358
|
+
u?: 'url' | 'srcset';
|
|
359
|
+
} |
|
|
360
|
+
/** `[class.n]="e"` */
|
|
361
|
+
{
|
|
362
|
+
t: 'c';
|
|
363
|
+
n: string;
|
|
364
|
+
e: CExpr;
|
|
365
|
+
} |
|
|
366
|
+
/** `[style.n(.x)]="e"` */
|
|
367
|
+
{
|
|
368
|
+
t: 'y';
|
|
369
|
+
n: string;
|
|
370
|
+
e: CExpr;
|
|
371
|
+
x?: string;
|
|
372
|
+
};
|
|
373
|
+
/** A checked template node, as the renderer walks it. */
|
|
8
374
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
375
|
+
* Slot content: its nodes, compiled in the caller's scope, and the offered
|
|
376
|
+
* values it takes (`let x = from`), each bound to caller slot `s`.
|
|
11
377
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
378
|
+
interface CFill {
|
|
379
|
+
nodes: CNode[];
|
|
380
|
+
params?: Array<{
|
|
381
|
+
from: string;
|
|
382
|
+
s: number;
|
|
383
|
+
}>;
|
|
384
|
+
}
|
|
385
|
+
type CNode =
|
|
386
|
+
/** static output */
|
|
387
|
+
{
|
|
388
|
+
k: 's';
|
|
389
|
+
t: string;
|
|
390
|
+
} |
|
|
391
|
+
/** `{{ e }}`: `text` escapes HTML (trusted HTML prints as is), `rcdata` (`<title>`, `<textarea>`) escapes everything, `json` is the one value of a JSON script */
|
|
392
|
+
{
|
|
393
|
+
k: 'i';
|
|
394
|
+
c: 'text' | 'rcdata' | 'json' | 'css';
|
|
395
|
+
e: CExpr;
|
|
396
|
+
at: At;
|
|
397
|
+
} |
|
|
398
|
+
/** the attributes of an element (between `<tag` and `>`); `f` takes a component caller's fallthrough attributes */
|
|
399
|
+
{
|
|
400
|
+
k: 'A';
|
|
401
|
+
tag: string;
|
|
402
|
+
a: CAttr[];
|
|
403
|
+
f?: 1;
|
|
404
|
+
at: At;
|
|
405
|
+
} | {
|
|
406
|
+
k: 'if';
|
|
407
|
+
br: Array<{
|
|
408
|
+
c?: CExpr;
|
|
409
|
+
a?: number;
|
|
410
|
+
b: CNode[];
|
|
411
|
+
}>;
|
|
412
|
+
} | {
|
|
413
|
+
k: 'for';
|
|
414
|
+
e: CExpr;
|
|
415
|
+
it: number | [number, number];
|
|
416
|
+
m: number;
|
|
417
|
+
b: CNode[];
|
|
418
|
+
em?: CNode[];
|
|
419
|
+
at: At;
|
|
420
|
+
} | {
|
|
421
|
+
k: 'sw';
|
|
422
|
+
e: CExpr;
|
|
423
|
+
cs: Array<{
|
|
424
|
+
e: CExpr;
|
|
425
|
+
b: CNode[];
|
|
426
|
+
}>;
|
|
427
|
+
d?: CNode[];
|
|
428
|
+
} | {
|
|
429
|
+
k: 'let';
|
|
430
|
+
s: number;
|
|
431
|
+
e: CExpr;
|
|
432
|
+
} |
|
|
433
|
+
/** a component: inputs into its slots, fallthrough attributes, slot fills (`''` is the default) */
|
|
434
|
+
{
|
|
435
|
+
k: 'cmp';
|
|
436
|
+
n: string;
|
|
437
|
+
in: Array<{
|
|
438
|
+
s: number;
|
|
439
|
+
e: CExpr;
|
|
440
|
+
}>;
|
|
441
|
+
/** inputs of wrapped components further down the chain, by name */
|
|
442
|
+
ci?: Array<{
|
|
443
|
+
n: string;
|
|
444
|
+
e: CExpr;
|
|
445
|
+
}>;
|
|
446
|
+
fa: CAttr[];
|
|
447
|
+
f: Record<string, CFill>;
|
|
448
|
+
/** this call is its template's root: it takes the caller's chained attributes */
|
|
449
|
+
r?: 1;
|
|
450
|
+
at: At;
|
|
451
|
+
} |
|
|
452
|
+
/**
|
|
453
|
+
* `<slot name="n" [x]="e">fallback</slot>`: `v` are the values it offers;
|
|
454
|
+
* while the fallback renders they sit in slots `fs` (same order).
|
|
455
|
+
*/
|
|
456
|
+
{
|
|
457
|
+
k: 'o';
|
|
458
|
+
n: string;
|
|
459
|
+
fb: CNode[];
|
|
460
|
+
v?: Array<{
|
|
461
|
+
n: string;
|
|
462
|
+
e: CExpr;
|
|
463
|
+
}>;
|
|
464
|
+
fs?: number[];
|
|
465
|
+
} |
|
|
466
|
+
/**
|
|
467
|
+
* `<component [is]="e" of="…">`: one compiled call per candidate tag, picked
|
|
468
|
+
* by `e`. The slot content `f` is compiled once, here, and given to whichever
|
|
469
|
+
* candidate renders (it's in the caller's scope, the same for all).
|
|
470
|
+
*/
|
|
471
|
+
{
|
|
472
|
+
k: 'dyn';
|
|
473
|
+
e: CExpr;
|
|
474
|
+
c: Record<string, CNode>;
|
|
475
|
+
f: Record<string, CFill>;
|
|
476
|
+
at: At;
|
|
477
|
+
} |
|
|
478
|
+
/** `@render n(args)`: run snippet `n` of the current template */
|
|
479
|
+
{
|
|
480
|
+
k: 'rnd';
|
|
481
|
+
n: string;
|
|
482
|
+
a: CExpr[];
|
|
483
|
+
at: At;
|
|
484
|
+
} |
|
|
485
|
+
/** `@push('n') { }`: rendered, then added to stack `n` */
|
|
486
|
+
{
|
|
487
|
+
k: 'push';
|
|
488
|
+
n: string;
|
|
489
|
+
b: CNode[];
|
|
490
|
+
} |
|
|
491
|
+
/** `<stack name="n" />`: filled once the render is done */
|
|
492
|
+
{
|
|
493
|
+
k: 'stk';
|
|
494
|
+
n: string;
|
|
495
|
+
} | {
|
|
496
|
+
k: 'as';
|
|
497
|
+
en: string;
|
|
498
|
+
};
|
|
499
|
+
/** A template after `check`: plain JSON the renderer walks, which a build can ship as data. */
|
|
500
|
+
/**
|
|
501
|
+
* A `@snippet`, in its own slot space: the template's inputs first (same
|
|
502
|
+
* indexes as in the template), then `params`, then its own variables.
|
|
503
|
+
*/
|
|
504
|
+
interface CSnippet {
|
|
505
|
+
params: number[];
|
|
506
|
+
defaults: Array<Literal | undefined>;
|
|
507
|
+
slots: number;
|
|
508
|
+
body: CNode[];
|
|
509
|
+
/** a field in it has `validate` */
|
|
510
|
+
validates?: true;
|
|
511
|
+
}
|
|
512
|
+
/** A page's `@fragment`, compiled to render on its own. */
|
|
513
|
+
interface CheckedFragment {
|
|
514
|
+
/** names enclosing blocks bound (loop items, aliases, `@let`): the caller passes them */
|
|
515
|
+
needs: string[];
|
|
516
|
+
/** scope slots the unit needs */
|
|
517
|
+
slots: number;
|
|
518
|
+
body: CNode[];
|
|
519
|
+
/** a field in it has `validate` */
|
|
520
|
+
validates?: true;
|
|
521
|
+
}
|
|
522
|
+
interface CheckedTemplate {
|
|
523
|
+
v: typeof AST_FORMAT_VERSION;
|
|
524
|
+
name: string;
|
|
525
|
+
file: string;
|
|
526
|
+
/** declared layout; `null` is `@layout(none)`; absent means the default layout applies to a page */
|
|
527
|
+
layout?: string | null;
|
|
528
|
+
/** scope slots the template needs */
|
|
529
|
+
slots: number;
|
|
530
|
+
/** a component's inputs: name, slot, default, required */
|
|
531
|
+
inputs: Array<{
|
|
532
|
+
n: string;
|
|
533
|
+
s: number;
|
|
534
|
+
d?: Literal;
|
|
535
|
+
r: boolean;
|
|
536
|
+
}>;
|
|
537
|
+
/** `@slot('name') { }` fills a page passes to its layout */
|
|
538
|
+
fills: Record<string, CFill>;
|
|
539
|
+
body: CNode[];
|
|
540
|
+
/** a component's `<script client>`: TypeScript as written (`js: false`), or plain JS once a build stripped it */
|
|
541
|
+
client?: {
|
|
542
|
+
code: string;
|
|
543
|
+
js: boolean;
|
|
544
|
+
};
|
|
545
|
+
/** a field in it has `validate`: pages rendering it ship the validator script */
|
|
546
|
+
validates?: true;
|
|
547
|
+
/** a page's `@input name = value` defaults: data that fills in when nobody supplied it */
|
|
548
|
+
defaults?: Record<string, Literal>;
|
|
549
|
+
/** its `@snippet`s, by name */
|
|
550
|
+
snippets?: Record<string, CSnippet>;
|
|
551
|
+
/** its `@fragment`s, by name */
|
|
552
|
+
fragments?: Record<string, CheckedFragment>;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Every `.kick` page by name: the data it reads and its fragments' needs.
|
|
556
|
+
* Filled by `kick typegen`; don't write entries by hand.
|
|
557
|
+
*
|
|
558
|
+
* @see https://kickjs.app/guide/views/typed-render-data
|
|
559
|
+
*/
|
|
560
|
+
interface KickViews {}
|
|
561
|
+
/**
|
|
562
|
+
* Names `createViews({ share })` supplies to every page, so a controller
|
|
563
|
+
* needn't pass them. Declare them once:
|
|
564
|
+
*
|
|
565
|
+
* ```ts
|
|
566
|
+
* declare module '@forinda/kickjs-view' {
|
|
567
|
+
* interface KickViewShared { user: User | undefined; csrfToken: string }
|
|
568
|
+
* }
|
|
569
|
+
* ```
|
|
570
|
+
*
|
|
571
|
+
* @see https://kickjs.app/guide/views/typed-render-data
|
|
572
|
+
*/
|
|
573
|
+
interface KickViewShared {}
|
|
574
|
+
/**
|
|
575
|
+
* Switches for the render types. `otherEngines: true` lets names outside
|
|
576
|
+
* {@link KickViews} through — for an app that also renders EJS or Pug with
|
|
577
|
+
* `ViewAdapter` (a misspelled `.kick` name then compiles too).
|
|
578
|
+
*
|
|
579
|
+
* @see https://kickjs.app/guide/views/typed-render-data
|
|
580
|
+
*/
|
|
581
|
+
interface KickViewTypeOptions {}
|
|
582
|
+
type Opts = Omit<RenderOptions, 'fragment'> & {
|
|
583
|
+
ctx?: unknown;
|
|
584
|
+
};
|
|
585
|
+
/** Template names `R` knows, `string` while it's empty or other engines are on. */
|
|
586
|
+
type ViewNameOf<R, O> = [keyof R] extends [never] ? string : O extends {
|
|
587
|
+
otherEngines: true;
|
|
588
|
+
} ? string : Extract<keyof R, string>;
|
|
589
|
+
type DataOf<R, N> = N extends keyof R ? (R[N] extends {
|
|
590
|
+
data: infer D;
|
|
591
|
+
} ? D : never) : never;
|
|
592
|
+
type Intersect<U> = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
|
|
593
|
+
/**
|
|
594
|
+
* Shared names may be left out; extra keys are fine. The union keeps an
|
|
595
|
+
* interface or class instance assignable (they have no index signature),
|
|
596
|
+
* while an object literal's extra keys are allowed by the second member.
|
|
597
|
+
*/
|
|
598
|
+
type Shaped<D, S> = Omit<D, keyof S> & Partial<Pick<D, Extract<keyof D, keyof S>>>;
|
|
599
|
+
type WithShared<D, S> = Shaped<D, S> | (Shaped<D, S> & Record<string, unknown>);
|
|
600
|
+
/** The data `ctx.render(N, data)` takes; for a union of names, what every one of those pages needs. */
|
|
601
|
+
type ViewDataOf<R, S, N> = [DataOf<R, N>] extends [never] ? Record<string, any> : WithShared<Intersect<DataOf<R, N>>, S>;
|
|
602
|
+
type FragmentsOf<R, N> = N extends keyof R ? (R[N] extends {
|
|
603
|
+
fragments: infer F;
|
|
604
|
+
} ? F : {}) : never;
|
|
605
|
+
/** A fragment name of page `N` (any string for names the registry doesn't know). */
|
|
606
|
+
type ViewFragmentNameOf<R, N> = [FragmentsOf<R, N>] extends [never] ? string : Extract<keyof FragmentsOf<R, N>, string>;
|
|
607
|
+
/** What `opts.fragment` may be: one fragment of page `N`, or a list of them. */
|
|
608
|
+
type FragmentNames<R, N> = ViewFragmentNameOf<R, N> | readonly ViewFragmentNameOf<R, N>[];
|
|
609
|
+
type Part<R, N, K, P extends 'needs' | 'reads'> = K extends keyof FragmentsOf<R, N> ? FragmentsOf<R, N>[K] extends Record<P, infer X> ? X : never : never;
|
|
610
|
+
type Listed<F> = F extends readonly (infer X)[] ? X : F;
|
|
611
|
+
/**
|
|
612
|
+
* The data a fragment render takes: for every fragment named, its needs
|
|
613
|
+
* exactly (the controller passes them; `share()` doesn't count at render),
|
|
614
|
+
* plus the page data it reads.
|
|
615
|
+
*/
|
|
616
|
+
type ViewFragmentDataOf<R, S, N, F> = [FragmentsOf<R, N>] extends [never] ? Record<string, any> : Intersect<Part<R, N, Listed<F>, 'needs'>> & WithShared<Intersect<Part<R, N, Listed<F>, 'reads'>>, S>;
|
|
617
|
+
/**
|
|
618
|
+
* The arguments after the name, without a fragment: `data` (required when
|
|
619
|
+
* the page needs any) and options. Fragment renders have their own overload.
|
|
620
|
+
*/
|
|
621
|
+
type RenderArgs<R, S, N> = [DataOf<R, N>] extends [never] ? [data?: Record<string, any>, opts?: Opts & {
|
|
622
|
+
fragment?: string | readonly string[];
|
|
623
|
+
}] : {} extends ViewDataOf<R, S, N> ? [data?: ViewDataOf<R, S, N>, opts?: Opts & {
|
|
624
|
+
fragment?: undefined;
|
|
625
|
+
}] : [data: ViewDataOf<R, S, N>, opts?: Opts & {
|
|
626
|
+
fragment?: undefined;
|
|
627
|
+
}];
|
|
628
|
+
/**
|
|
629
|
+
* What name `N` the loose overload takes: any string while the registry is
|
|
630
|
+
* empty (so generic helpers compile); with other engines on, any name but a
|
|
631
|
+
* registered one — a known page can't skip its data through it; else none.
|
|
632
|
+
*/
|
|
633
|
+
type LooseViewNameOf<R, O, N> = [keyof R] extends [never] ? string : O extends {
|
|
634
|
+
otherEngines: true;
|
|
635
|
+
} ? [Extract<N, keyof R>] extends [never] ? string : never : never;
|
|
636
|
+
/** The app's template names. */
|
|
637
|
+
type ViewName = ViewNameOf<KickViews, KickViewTypeOptions>;
|
|
638
|
+
/** The data page `N` takes. */
|
|
639
|
+
type ViewData<N> = ViewDataOf<KickViews, KickViewShared, N>;
|
|
640
|
+
/** Arguments after the name, for the app's registry. */
|
|
641
|
+
type ViewRenderArgs<N> = RenderArgs<KickViews, KickViewShared, N>;
|
|
642
|
+
/** `opts.fragment` for page `N`. */
|
|
643
|
+
type ViewFragmentNames<N> = FragmentNames<KickViews, N>;
|
|
644
|
+
/** The data a fragment render of page `N` takes. */
|
|
645
|
+
type ViewFragmentData<N, F> = ViewFragmentDataOf<KickViews, KickViewShared, N, F>;
|
|
646
|
+
/** The loose overload's name, for the app's registry. */
|
|
647
|
+
type LooseViewName<N> = LooseViewNameOf<KickViews, KickViewTypeOptions, N>;
|
|
16
648
|
/** A pipe: takes the piped value and the pipe's arguments, returns the new value. */
|
|
17
649
|
type Pipe = (value: unknown, ...args: unknown[]) => unknown;
|
|
18
650
|
/** What a render needs besides the data: locale, pipes, how to resolve layouts and components. */
|
|
@@ -83,12 +715,19 @@ declare const escapeJsonForScript: (json: string) => string;
|
|
|
83
715
|
declare function safeStyleValue(v: string): string | undefined;
|
|
84
716
|
/** The names of the built-in pipes. */
|
|
85
717
|
declare const BUILTIN_PIPES: readonly string[];
|
|
718
|
+
/**
|
|
719
|
+
* Built-ins added later: an app pipe of the same name wins, so apps that
|
|
720
|
+
* already had their own `ago` or `truncate` keep it.
|
|
721
|
+
*/
|
|
722
|
+
declare const OVERRIDABLE_PIPES: readonly string[];
|
|
86
723
|
/** What built-in pipes read from the render: locale, time zone, and the request's `urlFor`. */
|
|
87
724
|
interface PipeEnv {
|
|
88
725
|
locale: string;
|
|
89
726
|
timeZone: string;
|
|
90
727
|
/** The request's `ctx.urlFor` (params in path order), for `kvRoute`. Absent outside a request. */
|
|
91
728
|
urlFor?: (name: string, params: Array<string | number>) => string;
|
|
729
|
+
/** The render's message lookup, for `t`; absent outside `createViews` (then `t` prints the key). */
|
|
730
|
+
translate?: (key: string, params: Record<string, unknown>) => string;
|
|
92
731
|
}
|
|
93
732
|
/**
|
|
94
733
|
* The built-in pipes bound to a render's locale and time zone (`date`, `currency`, `kvRoute`, ...).
|
|
@@ -168,6 +807,13 @@ interface ViewsOptions {
|
|
|
168
807
|
/** Default `<viewsDir>/validators.ts`: the app's browser validators. Read when there is no bundle. */
|
|
169
808
|
validatorsFile?: string;
|
|
170
809
|
pipes?: Record<string, Pipe | EnvPipe>;
|
|
810
|
+
/**
|
|
811
|
+
* Message catalogues for `t`: locale → dot key → message. Default: read from
|
|
812
|
+
* `<viewsDir>/locales/*.json` (the Vite plugin bundles them as `messages`).
|
|
813
|
+
*/
|
|
814
|
+
messages?: Messages;
|
|
815
|
+
/** The locale a message falls back to. Default: `locale`, else `en-US`. */
|
|
816
|
+
messagesLocale?: string;
|
|
171
817
|
/**
|
|
172
818
|
* The layout a page gets when it declares none: one name, or folder prefix →
|
|
173
819
|
* layout (`{ admin: 'layouts/admin', '': 'layouts/main' }`; the longest prefix wins).
|
|
@@ -228,6 +874,10 @@ interface Views {
|
|
|
228
874
|
readonly clientScriptPath: string;
|
|
229
875
|
/** Whether `name` is one of these views — `ctx.render` falls through to another engine when not. */
|
|
230
876
|
has(name: string): Promise<boolean>;
|
|
877
|
+
/** A message from the catalogues, as `t` prints it: for controllers, emails and flash messages. */
|
|
878
|
+
t(key: string, params?: Record<string, unknown>, opts?: {
|
|
879
|
+
locale?: string;
|
|
880
|
+
}): Promise<string>;
|
|
231
881
|
}
|
|
232
882
|
/** A loader over a build's bundle; throws when the bundle's format version doesn't match this runtime. */
|
|
233
883
|
declare function bundleLoader(bundle: ViewsBundle): Loader;
|
|
@@ -256,99 +906,20 @@ declare function useClientFiles(read: ((url: URL) => Promise<Uint8Array>) | unde
|
|
|
256
906
|
* @see https://kickjs.app/guide/views
|
|
257
907
|
*/
|
|
258
908
|
declare function createViews(options?: ViewsOptions): Views;
|
|
909
|
+
declare namespace file_d_exports {
|
|
910
|
+
export { fileLoader, loadPipesFile, multiRootLoader, readCatalogs, readTextFile };
|
|
911
|
+
}
|
|
912
|
+
declare function fileLoader(viewsDir: string): Loader;
|
|
259
913
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* @see https://kickjs.app/guide/views/typed-render-data
|
|
264
|
-
*/
|
|
265
|
-
interface KickViews {}
|
|
266
|
-
/**
|
|
267
|
-
* Names `createViews({ share })` supplies to every page, so a controller
|
|
268
|
-
* needn't pass them. Declare them once:
|
|
269
|
-
*
|
|
270
|
-
* ```ts
|
|
271
|
-
* declare module '@forinda/kickjs-view' {
|
|
272
|
-
* interface KickViewShared { user: User | undefined; csrfToken: string }
|
|
273
|
-
* }
|
|
274
|
-
* ```
|
|
275
|
-
*
|
|
276
|
-
* @see https://kickjs.app/guide/views/typed-render-data
|
|
277
|
-
*/
|
|
278
|
-
interface KickViewShared {}
|
|
279
|
-
/**
|
|
280
|
-
* Switches for the render types. `otherEngines: true` lets names outside
|
|
281
|
-
* {@link KickViews} through — for an app that also renders EJS or Pug with
|
|
282
|
-
* `ViewAdapter` (a misspelled `.kick` name then compiles too).
|
|
283
|
-
*
|
|
284
|
-
* @see https://kickjs.app/guide/views/typed-render-data
|
|
285
|
-
*/
|
|
286
|
-
interface KickViewTypeOptions {}
|
|
287
|
-
type Opts = Omit<RenderOptions, 'fragment'> & {
|
|
288
|
-
ctx?: unknown;
|
|
289
|
-
};
|
|
290
|
-
/** Template names `R` knows, `string` while it's empty or other engines are on. */
|
|
291
|
-
type ViewNameOf<R, O> = [keyof R] extends [never] ? string : O extends {
|
|
292
|
-
otherEngines: true;
|
|
293
|
-
} ? string : Extract<keyof R, string>;
|
|
294
|
-
type DataOf<R, N> = N extends keyof R ? (R[N] extends {
|
|
295
|
-
data: infer D;
|
|
296
|
-
} ? D : never) : never;
|
|
297
|
-
type Intersect<U> = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
|
|
298
|
-
/**
|
|
299
|
-
* Shared names may be left out; extra keys are fine. The union keeps an
|
|
300
|
-
* interface or class instance assignable (they have no index signature),
|
|
301
|
-
* while an object literal's extra keys are allowed by the second member.
|
|
302
|
-
*/
|
|
303
|
-
type Shaped<D, S> = Omit<D, keyof S> & Partial<Pick<D, Extract<keyof D, keyof S>>>;
|
|
304
|
-
type WithShared<D, S> = Shaped<D, S> | (Shaped<D, S> & Record<string, unknown>);
|
|
305
|
-
/** The data `ctx.render(N, data)` takes; for a union of names, what every one of those pages needs. */
|
|
306
|
-
type ViewDataOf<R, S, N> = [DataOf<R, N>] extends [never] ? Record<string, any> : WithShared<Intersect<DataOf<R, N>>, S>;
|
|
307
|
-
type FragmentsOf<R, N> = N extends keyof R ? (R[N] extends {
|
|
308
|
-
fragments: infer F;
|
|
309
|
-
} ? F : {}) : never;
|
|
310
|
-
/** A fragment name of page `N` (any string for names the registry doesn't know). */
|
|
311
|
-
type ViewFragmentNameOf<R, N> = [FragmentsOf<R, N>] extends [never] ? string : Extract<keyof FragmentsOf<R, N>, string>;
|
|
312
|
-
/** What `opts.fragment` may be: one fragment of page `N`, or a list of them. */
|
|
313
|
-
type FragmentNames<R, N> = ViewFragmentNameOf<R, N> | readonly ViewFragmentNameOf<R, N>[];
|
|
314
|
-
type Part<R, N, K, P extends 'needs' | 'reads'> = K extends keyof FragmentsOf<R, N> ? FragmentsOf<R, N>[K] extends Record<P, infer X> ? X : never : never;
|
|
315
|
-
type Listed<F> = F extends readonly (infer X)[] ? X : F;
|
|
316
|
-
/**
|
|
317
|
-
* The data a fragment render takes: for every fragment named, its needs
|
|
318
|
-
* exactly (the controller passes them; `share()` doesn't count at render),
|
|
319
|
-
* plus the page data it reads.
|
|
320
|
-
*/
|
|
321
|
-
type ViewFragmentDataOf<R, S, N, F> = [FragmentsOf<R, N>] extends [never] ? Record<string, any> : Intersect<Part<R, N, Listed<F>, 'needs'>> & WithShared<Intersect<Part<R, N, Listed<F>, 'reads'>>, S>;
|
|
322
|
-
/**
|
|
323
|
-
* The arguments after the name, without a fragment: `data` (required when
|
|
324
|
-
* the page needs any) and options. Fragment renders have their own overload.
|
|
325
|
-
*/
|
|
326
|
-
type RenderArgs<R, S, N> = [DataOf<R, N>] extends [never] ? [data?: Record<string, any>, opts?: Opts & {
|
|
327
|
-
fragment?: string | readonly string[];
|
|
328
|
-
}] : {} extends ViewDataOf<R, S, N> ? [data?: ViewDataOf<R, S, N>, opts?: Opts & {
|
|
329
|
-
fragment?: undefined;
|
|
330
|
-
}] : [data: ViewDataOf<R, S, N>, opts?: Opts & {
|
|
331
|
-
fragment?: undefined;
|
|
332
|
-
}];
|
|
333
|
-
/**
|
|
334
|
-
* What name `N` the loose overload takes: any string while the registry is
|
|
335
|
-
* empty (so generic helpers compile); with other engines on, any name but a
|
|
336
|
-
* registered one — a known page can't skip its data through it; else none.
|
|
914
|
+
* The app's views folder plus named roots: a root's templates are listed and
|
|
915
|
+
* read as `root::path`.
|
|
337
916
|
*/
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
/** `opts.fragment` for page `N`. */
|
|
348
|
-
type ViewFragmentNames<N> = FragmentNames<KickViews, N>;
|
|
349
|
-
/** The data a fragment render of page `N` takes. */
|
|
350
|
-
type ViewFragmentData<N, F> = ViewFragmentDataOf<KickViews, KickViewShared, N, F>;
|
|
351
|
-
/** The loose overload's name, for the app's registry. */
|
|
352
|
-
type LooseViewName<N> = LooseViewNameOf<KickViews, KickViewTypeOptions, N>;
|
|
353
|
-
export { PipeEnv as A, Pipe as B, useFileLoader as C, safeHtml as D, pipesFor as E, read as F, loadPipesFile as G, RenderError as H, safeStyleValue as I, multiRootLoader as K, sanitizeSrcset as L, SafeHtml as M, escapeHtml as N, withEnv as O, escapeJsonForScript as P, sanitizeUrl as R, useClientFiles as S, EnvPipe as T, render as U, RenderEnv as V, fileLoader as W, Views as _, LooseViewNameOf as a, bundleLoader as b, ViewDataOf as c, ViewName as d, ViewNameOf as f, ShareContext as g, RenderOptions as h, KickViews as i, builtinPipes as j, BUILTIN_PIPES as k, ViewFragmentData as l, Loader as m, KickViewShared as n, RenderArgs as o, ViewRenderArgs as p, readTextFile as q, KickViewTypeOptions as r, ViewData as s, FragmentNames as t, ViewFragmentDataOf as u, ViewsBundle as v, useStripTypes as w, createViews as x, ViewsOptions as y, MAX_DEPTH as z };
|
|
354
|
-
//# sourceMappingURL=types-D-OIrXCW.d.ts.map
|
|
917
|
+
declare function multiRootLoader(appDir: string, roots: Record<string, string>): Loader;
|
|
918
|
+
/** The app's pipes file, if there is one, imported as a module. */
|
|
919
|
+
declare function loadPipesFile(file: string): Promise<Record<string, unknown> | undefined>;
|
|
920
|
+
/** A text file's contents, or undefined when there's none. */
|
|
921
|
+
declare function readTextFile(file: string): Promise<string | undefined>;
|
|
922
|
+
/** Every `<locale>.json` in `dir`; `undefined` when there's no such folder. */
|
|
923
|
+
declare function readCatalogs(dir: string): Promise<Messages | undefined>;
|
|
924
|
+
export { CExpr as $, sanitizeSrcset as A, KickViews as B, PipeEnv as C, escapeJsonForScript as D, escapeHtml as E, RenderError as F, ViewFragmentData as G, RenderArgs as H, render as I, ViewNameOf as J, ViewFragmentDataOf as K, FragmentNames as L, MAX_DEPTH as M, Pipe as N, read as O, RenderEnv as P, CAttr as Q, KickViewShared as R, OVERRIDABLE_PIPES as S, SafeHtml as T, ViewData as U, LooseViewNameOf as V, ViewDataOf as W, AST_FORMAT_VERSION as X, ViewRenderArgs as Y, Attr as Z, EnvPipe as _, CatalogIndex as _t, readTextFile as a, Expr as at, withEnv as b, catalogIndex as bt, ShareContext as c, Literal as ct, ViewsOptions as d, PathSegment as dt, CNode as et, bundleLoader as f, TemplateAst as ft, useStripTypes as g, positionAt as gt, useFileLoader as h, Span as ht, readCatalogs as i, Element as it, sanitizeUrl as j, safeStyleValue as k, Views as l, LoopVar as lt, useClientFiles as m, Pos as mt, loadPipesFile as n, CheckedTemplate as nt, Loader as o, IfBranch as ot, createViews as p, Diagnostic as pt, ViewName as q, multiRootLoader as r, Ctx as rt, RenderOptions as s, InputDecl as st, fileLoader as t, CSeg as tt, ViewsBundle as u, Node as ut, pipesFor as v, Message as vt, builtinPipes as w, BUILTIN_PIPES as x, safeHtml as y, Messages as yt, KickViewTypeOptions as z };
|
|
925
|
+
//# sourceMappingURL=file-BIua9gOB.d.ts.map
|