@media-quest/builder 0.0.10 → 0.0.12
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/public-api.d.mts +27 -25
- package/dist/public-api.d.ts +27 -25
- package/dist/public-api.js +38 -34
- package/dist/public-api.mjs +38 -34
- package/package.json +2 -2
- package/src/Builder-page.spec.ts +2 -1
- package/src/Builder-page.ts +3 -1
- package/src/Builder-schema.spec.ts +3 -2
- package/src/Builder-schema.ts +10 -19
- package/src/primitives/page-prefix.ts +58 -0
- package/src/primitives/prefix.ts +0 -0
- package/src/primitives/schema-prefix.ts +52 -0
- package/src/primitives/varID.ts +11 -0
- package/src/public-api.ts +3 -1
- package/src/rulebuilder/Builder-rule.spec.ts +3 -1
- package/src/rulebuilder/Builder-rule.ts +2 -2
- package/src/rulebuilder/RuleAction.ts +82 -1
- package/src/rulebuilder/RuleBuilder-test-utils.ts +3 -1
- package/src/rulebuilder/RuleVariable.ts +3 -1
- package/src/rulebuilder/condition/Builder-condition.spec.ts +2 -1
- package/src/rulebuilder/multi-select-item.ts +0 -5
- package/src/rulebuilder/page-action-manager.ts +2 -1
- package/src/prefix.ts +0 -107
- /package/src/{prefix.spec.ts → primitives/prefix.spec.ts} +0 -0
package/dist/public-api.d.mts
CHANGED
|
@@ -167,15 +167,26 @@ declare class BuilderMainText extends BuilderObject<"builder-main-text", Builder
|
|
|
167
167
|
set audioFile(audioFile: AudioFile | false);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
type SchemaPrefixValue = string & {
|
|
171
|
-
__SCHEMA_PREFIX__: true;
|
|
172
|
-
};
|
|
173
170
|
type PagePrefixValue = string & {
|
|
174
171
|
__PAGE_PREFIX__: true;
|
|
175
172
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
declare class PagePrefix {
|
|
174
|
+
private _value;
|
|
175
|
+
static readonly MIN_LENGTH = 1;
|
|
176
|
+
private static randomLen;
|
|
177
|
+
static readonly MAX_LENGTH = 16;
|
|
178
|
+
static create: () => PagePrefix;
|
|
179
|
+
static fromString: (value: string) => PagePrefix | false;
|
|
180
|
+
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
181
|
+
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
182
|
+
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
183
|
+
get value(): PagePrefixValue;
|
|
184
|
+
set value(value: string);
|
|
185
|
+
private constructor();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
type SchemaPrefixValue = string & {
|
|
189
|
+
__SCHEMA_PREFIX__: true;
|
|
179
190
|
};
|
|
180
191
|
declare class SchemaPrefix {
|
|
181
192
|
private _value;
|
|
@@ -187,25 +198,17 @@ declare class SchemaPrefix {
|
|
|
187
198
|
static fromString: (value: string) => SchemaPrefix | false;
|
|
188
199
|
static castOrCreateRandom: (value: string) => SchemaPrefix;
|
|
189
200
|
static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
|
|
201
|
+
toJSON(): void;
|
|
190
202
|
get value(): SchemaPrefixValue;
|
|
203
|
+
get isValid(): boolean;
|
|
191
204
|
set value(value: string);
|
|
192
205
|
private constructor();
|
|
193
206
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
static fromValue: (value: PagePrefixValue) => PagePrefix;
|
|
200
|
-
static create: () => PagePrefix;
|
|
201
|
-
static fromString: (value: string) => PagePrefix | false;
|
|
202
|
-
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
203
|
-
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
204
|
-
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
205
|
-
get value(): PagePrefixValue;
|
|
206
|
-
set value(value: string);
|
|
207
|
-
private constructor();
|
|
208
|
-
}
|
|
207
|
+
|
|
208
|
+
type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
|
|
209
|
+
declare const VarID: {
|
|
210
|
+
create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
|
|
211
|
+
};
|
|
209
212
|
|
|
210
213
|
declare const BuilderVariableType: {
|
|
211
214
|
readonly numericWithOptions: true;
|
|
@@ -567,7 +570,7 @@ interface BuilderRuleDto {
|
|
|
567
570
|
readonly name: string;
|
|
568
571
|
readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
|
|
569
572
|
readonly excludeTags: ReadonlyArray<string>;
|
|
570
|
-
readonly excludePages: ReadonlyArray<
|
|
573
|
+
readonly excludePages: ReadonlyArray<PageID>;
|
|
571
574
|
readonly jumpToPage: string | false;
|
|
572
575
|
}
|
|
573
576
|
declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
|
|
@@ -602,7 +605,7 @@ declare class PageActionManager {
|
|
|
602
605
|
private readonly _initialSelection;
|
|
603
606
|
readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
|
|
604
607
|
constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
|
|
605
|
-
getCurrentSelection(): ReadonlyArray<
|
|
608
|
+
getCurrentSelection(): ReadonlyArray<PageID>;
|
|
606
609
|
getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
|
|
607
610
|
}
|
|
608
611
|
|
|
@@ -636,7 +639,7 @@ interface SchemaBuildOutput {
|
|
|
636
639
|
declare class BuilderSchema {
|
|
637
640
|
readonly id: SchemaID;
|
|
638
641
|
name: string;
|
|
639
|
-
|
|
642
|
+
readonly prefix: SchemaPrefix;
|
|
640
643
|
baseHeight: number;
|
|
641
644
|
baseWidth: number;
|
|
642
645
|
backgroundColor: string;
|
|
@@ -644,7 +647,6 @@ declare class BuilderSchema {
|
|
|
644
647
|
mainImage: ImageFile | false;
|
|
645
648
|
private _rules;
|
|
646
649
|
get rules(): ReadonlyArray<BuilderRule>;
|
|
647
|
-
get prefix(): SchemaPrefixValue;
|
|
648
650
|
private readonly _tagCollection;
|
|
649
651
|
get tags(): ReadonlyArray<BuilderTag>;
|
|
650
652
|
static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
|
package/dist/public-api.d.ts
CHANGED
|
@@ -167,15 +167,26 @@ declare class BuilderMainText extends BuilderObject<"builder-main-text", Builder
|
|
|
167
167
|
set audioFile(audioFile: AudioFile | false);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
type SchemaPrefixValue = string & {
|
|
171
|
-
__SCHEMA_PREFIX__: true;
|
|
172
|
-
};
|
|
173
170
|
type PagePrefixValue = string & {
|
|
174
171
|
__PAGE_PREFIX__: true;
|
|
175
172
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
declare class PagePrefix {
|
|
174
|
+
private _value;
|
|
175
|
+
static readonly MIN_LENGTH = 1;
|
|
176
|
+
private static randomLen;
|
|
177
|
+
static readonly MAX_LENGTH = 16;
|
|
178
|
+
static create: () => PagePrefix;
|
|
179
|
+
static fromString: (value: string) => PagePrefix | false;
|
|
180
|
+
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
181
|
+
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
182
|
+
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
183
|
+
get value(): PagePrefixValue;
|
|
184
|
+
set value(value: string);
|
|
185
|
+
private constructor();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
type SchemaPrefixValue = string & {
|
|
189
|
+
__SCHEMA_PREFIX__: true;
|
|
179
190
|
};
|
|
180
191
|
declare class SchemaPrefix {
|
|
181
192
|
private _value;
|
|
@@ -187,25 +198,17 @@ declare class SchemaPrefix {
|
|
|
187
198
|
static fromString: (value: string) => SchemaPrefix | false;
|
|
188
199
|
static castOrCreateRandom: (value: string) => SchemaPrefix;
|
|
189
200
|
static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
|
|
201
|
+
toJSON(): void;
|
|
190
202
|
get value(): SchemaPrefixValue;
|
|
203
|
+
get isValid(): boolean;
|
|
191
204
|
set value(value: string);
|
|
192
205
|
private constructor();
|
|
193
206
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
static fromValue: (value: PagePrefixValue) => PagePrefix;
|
|
200
|
-
static create: () => PagePrefix;
|
|
201
|
-
static fromString: (value: string) => PagePrefix | false;
|
|
202
|
-
static fromStringOrThrow: (value: string) => PagePrefixValue;
|
|
203
|
-
static castOrCreateRandom: (value: string) => PagePrefix;
|
|
204
|
-
static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
|
|
205
|
-
get value(): PagePrefixValue;
|
|
206
|
-
set value(value: string);
|
|
207
|
-
private constructor();
|
|
208
|
-
}
|
|
207
|
+
|
|
208
|
+
type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
|
|
209
|
+
declare const VarID: {
|
|
210
|
+
create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
|
|
211
|
+
};
|
|
209
212
|
|
|
210
213
|
declare const BuilderVariableType: {
|
|
211
214
|
readonly numericWithOptions: true;
|
|
@@ -567,7 +570,7 @@ interface BuilderRuleDto {
|
|
|
567
570
|
readonly name: string;
|
|
568
571
|
readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
|
|
569
572
|
readonly excludeTags: ReadonlyArray<string>;
|
|
570
|
-
readonly excludePages: ReadonlyArray<
|
|
573
|
+
readonly excludePages: ReadonlyArray<PageID>;
|
|
571
574
|
readonly jumpToPage: string | false;
|
|
572
575
|
}
|
|
573
576
|
declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
|
|
@@ -602,7 +605,7 @@ declare class PageActionManager {
|
|
|
602
605
|
private readonly _initialSelection;
|
|
603
606
|
readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
|
|
604
607
|
constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
|
|
605
|
-
getCurrentSelection(): ReadonlyArray<
|
|
608
|
+
getCurrentSelection(): ReadonlyArray<PageID>;
|
|
606
609
|
getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
|
|
607
610
|
}
|
|
608
611
|
|
|
@@ -636,7 +639,7 @@ interface SchemaBuildOutput {
|
|
|
636
639
|
declare class BuilderSchema {
|
|
637
640
|
readonly id: SchemaID;
|
|
638
641
|
name: string;
|
|
639
|
-
|
|
642
|
+
readonly prefix: SchemaPrefix;
|
|
640
643
|
baseHeight: number;
|
|
641
644
|
baseWidth: number;
|
|
642
645
|
backgroundColor: string;
|
|
@@ -644,7 +647,6 @@ declare class BuilderSchema {
|
|
|
644
647
|
mainImage: ImageFile | false;
|
|
645
648
|
private _rules;
|
|
646
649
|
get rules(): ReadonlyArray<BuilderRule>;
|
|
647
|
-
get prefix(): SchemaPrefixValue;
|
|
648
650
|
private readonly _tagCollection;
|
|
649
651
|
get tags(): ReadonlyArray<BuilderTag>;
|
|
650
652
|
static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
|