kaleidl 0.1.1 → 0.1.3
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 +1 -1
- package/dist/index.cjs +621 -0
- package/dist/index.d.cts +78 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +608 -0
- package/dist/lml-artifact.cjs +11 -0
- package/dist/lml-artifact.d.cts +8 -0
- package/dist/lml-artifact.d.ts +8 -0
- package/dist/lml-artifact.js +8 -0
- package/dist/lml.cjs +68 -0
- package/dist/lml.d.cts +5 -0
- package/dist/lml.d.ts +5 -0
- package/dist/lml.js +63 -0
- package/dist/node-loaders.cjs +42 -0
- package/dist/node-loaders.d.cts +7 -0
- package/dist/node-loaders.d.ts +7 -0
- package/dist/node-loaders.js +39 -0
- package/dist/node.cjs +12 -0
- package/dist/node.d.cts +1 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +12 -0
- package/package.json +24 -5
- package/src/index.ts +1 -6
- package/src/lml-artifact.ts +8 -0
- package/src/lml.ts +81 -0
- package/src/node-cjs.ts +11 -0
- package/src/node-loaders.ts +49 -0
- package/src/node.ts +15 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface Instance {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
properties: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export interface Profile {
|
|
7
|
+
instances: Record<string, Instance>;
|
|
8
|
+
}
|
|
9
|
+
export interface Element {
|
|
10
|
+
type: string;
|
|
11
|
+
id: string;
|
|
12
|
+
context?: string | null;
|
|
13
|
+
children?: Element[];
|
|
14
|
+
}
|
|
15
|
+
export interface Label {
|
|
16
|
+
value: string;
|
|
17
|
+
reference: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class ResolutionError extends Error {
|
|
20
|
+
}
|
|
21
|
+
export declare const LABEL_VOCABULARY: Record<string, string>;
|
|
22
|
+
export declare function ref(instance: Instance, key: string): string;
|
|
23
|
+
export declare function refs(instance: Instance, key: string): string[];
|
|
24
|
+
export declare const FLUENT_MAX_DEPTH = 5;
|
|
25
|
+
export declare function messageTable(bindings: Record<string, any>): Record<string, string>;
|
|
26
|
+
export declare function resolveMessage(value: string, bindings: Record<string, any>, depth?: number): string;
|
|
27
|
+
export declare function render(pattern: string, bindings: Record<string, any>): string;
|
|
28
|
+
export declare function loadProfile(text: string): Profile;
|
|
29
|
+
export declare class SequenceExhaustedError extends Error {
|
|
30
|
+
}
|
|
31
|
+
export declare const BUILTIN_SEQUENCE_SPECS: Record<string, {
|
|
32
|
+
type: string;
|
|
33
|
+
properties: Record<string, any>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const Formatters: {
|
|
36
|
+
format(fmt: string, number: number): string;
|
|
37
|
+
roman(number: number): string;
|
|
38
|
+
alpha(number: number): string;
|
|
39
|
+
eastAsian(fmt: string, number: number): string;
|
|
40
|
+
cjkUnits: Record<string, string[]>;
|
|
41
|
+
cjkSmallTen: Record<string, string>;
|
|
42
|
+
cjkSmallHundred: Record<string, string>;
|
|
43
|
+
cjkSmallThousand: Record<string, string>;
|
|
44
|
+
compound(units: string[], count: number, marker: string, dropSingleUnit: boolean): string;
|
|
45
|
+
digits(number: number, radix: number): number[];
|
|
46
|
+
};
|
|
47
|
+
export declare class Resolver {
|
|
48
|
+
profile: Profile;
|
|
49
|
+
private nameOf;
|
|
50
|
+
private labellersByContext;
|
|
51
|
+
constructor(profile: Profile);
|
|
52
|
+
labellerForContext(context: string, elementType: string): Instance | null;
|
|
53
|
+
instanceNameOf(labeller: Instance): string;
|
|
54
|
+
ancestorChain(labellerName: string): string[];
|
|
55
|
+
}
|
|
56
|
+
export declare class Engine {
|
|
57
|
+
labels: Map<string, Label>;
|
|
58
|
+
private resolved;
|
|
59
|
+
private labelsInput;
|
|
60
|
+
private plan;
|
|
61
|
+
private totals;
|
|
62
|
+
constructor(profile: Profile, labels?: Record<string, string>);
|
|
63
|
+
label(tree: Element): this;
|
|
64
|
+
private walk;
|
|
65
|
+
private resolveOwnLabel;
|
|
66
|
+
private nearestAssociation;
|
|
67
|
+
private planElement;
|
|
68
|
+
private findParentEntry;
|
|
69
|
+
private incrementCounter;
|
|
70
|
+
private sequenceRaw;
|
|
71
|
+
private lookupSequence;
|
|
72
|
+
private sequenceValue;
|
|
73
|
+
private numericValue;
|
|
74
|
+
private characterValue;
|
|
75
|
+
private prefixesFor;
|
|
76
|
+
private render;
|
|
77
|
+
private templates;
|
|
78
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface Instance {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
properties: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export interface Profile {
|
|
7
|
+
instances: Record<string, Instance>;
|
|
8
|
+
}
|
|
9
|
+
export interface Element {
|
|
10
|
+
type: string;
|
|
11
|
+
id: string;
|
|
12
|
+
context?: string | null;
|
|
13
|
+
children?: Element[];
|
|
14
|
+
}
|
|
15
|
+
export interface Label {
|
|
16
|
+
value: string;
|
|
17
|
+
reference: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class ResolutionError extends Error {
|
|
20
|
+
}
|
|
21
|
+
export declare const LABEL_VOCABULARY: Record<string, string>;
|
|
22
|
+
export declare function ref(instance: Instance, key: string): string;
|
|
23
|
+
export declare function refs(instance: Instance, key: string): string[];
|
|
24
|
+
export declare const FLUENT_MAX_DEPTH = 5;
|
|
25
|
+
export declare function messageTable(bindings: Record<string, any>): Record<string, string>;
|
|
26
|
+
export declare function resolveMessage(value: string, bindings: Record<string, any>, depth?: number): string;
|
|
27
|
+
export declare function render(pattern: string, bindings: Record<string, any>): string;
|
|
28
|
+
export declare function loadProfile(text: string): Profile;
|
|
29
|
+
export declare class SequenceExhaustedError extends Error {
|
|
30
|
+
}
|
|
31
|
+
export declare const BUILTIN_SEQUENCE_SPECS: Record<string, {
|
|
32
|
+
type: string;
|
|
33
|
+
properties: Record<string, any>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const Formatters: {
|
|
36
|
+
format(fmt: string, number: number): string;
|
|
37
|
+
roman(number: number): string;
|
|
38
|
+
alpha(number: number): string;
|
|
39
|
+
eastAsian(fmt: string, number: number): string;
|
|
40
|
+
cjkUnits: Record<string, string[]>;
|
|
41
|
+
cjkSmallTen: Record<string, string>;
|
|
42
|
+
cjkSmallHundred: Record<string, string>;
|
|
43
|
+
cjkSmallThousand: Record<string, string>;
|
|
44
|
+
compound(units: string[], count: number, marker: string, dropSingleUnit: boolean): string;
|
|
45
|
+
digits(number: number, radix: number): number[];
|
|
46
|
+
};
|
|
47
|
+
export declare class Resolver {
|
|
48
|
+
profile: Profile;
|
|
49
|
+
private nameOf;
|
|
50
|
+
private labellersByContext;
|
|
51
|
+
constructor(profile: Profile);
|
|
52
|
+
labellerForContext(context: string, elementType: string): Instance | null;
|
|
53
|
+
instanceNameOf(labeller: Instance): string;
|
|
54
|
+
ancestorChain(labellerName: string): string[];
|
|
55
|
+
}
|
|
56
|
+
export declare class Engine {
|
|
57
|
+
labels: Map<string, Label>;
|
|
58
|
+
private resolved;
|
|
59
|
+
private labelsInput;
|
|
60
|
+
private plan;
|
|
61
|
+
private totals;
|
|
62
|
+
constructor(profile: Profile, labels?: Record<string, string>);
|
|
63
|
+
label(tree: Element): this;
|
|
64
|
+
private walk;
|
|
65
|
+
private resolveOwnLabel;
|
|
66
|
+
private nearestAssociation;
|
|
67
|
+
private planElement;
|
|
68
|
+
private findParentEntry;
|
|
69
|
+
private incrementCounter;
|
|
70
|
+
private sequenceRaw;
|
|
71
|
+
private lookupSequence;
|
|
72
|
+
private sequenceValue;
|
|
73
|
+
private numericValue;
|
|
74
|
+
private characterValue;
|
|
75
|
+
private prefixesFor;
|
|
76
|
+
private render;
|
|
77
|
+
private templates;
|
|
78
|
+
}
|