@media-quest/builder 0.0.10 → 0.0.11

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.
@@ -167,15 +167,27 @@ 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
- type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
177
- declare const VarID: {
178
- create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
173
+ declare const createRandomPrefix: <const P extends string>(length: number) => P;
174
+ declare class PagePrefix {
175
+ private _value;
176
+ static readonly MIN_LENGTH = 1;
177
+ private static randomLen;
178
+ static readonly MAX_LENGTH = 16;
179
+ static create: () => PagePrefix;
180
+ static fromString: (value: string) => PagePrefix | false;
181
+ static fromStringOrThrow: (value: string) => PagePrefixValue;
182
+ static castOrCreateRandom: (value: string) => PagePrefix;
183
+ static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
184
+ get value(): PagePrefixValue;
185
+ set value(value: string);
186
+ private constructor();
187
+ }
188
+
189
+ type SchemaPrefixValue = string & {
190
+ __SCHEMA_PREFIX__: true;
179
191
  };
180
192
  declare class SchemaPrefix {
181
193
  private _value;
@@ -187,25 +199,17 @@ declare class SchemaPrefix {
187
199
  static fromString: (value: string) => SchemaPrefix | false;
188
200
  static castOrCreateRandom: (value: string) => SchemaPrefix;
189
201
  static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
202
+ toJSON(): void;
190
203
  get value(): SchemaPrefixValue;
204
+ get isValid(): boolean;
191
205
  set value(value: string);
192
206
  private constructor();
193
207
  }
194
- declare class PagePrefix {
195
- private _value;
196
- static readonly MIN_LENGTH = 1;
197
- private static randomLen;
198
- static readonly MAX_LENGTH = 16;
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
- }
208
+
209
+ type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
210
+ declare const VarID: {
211
+ create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
212
+ };
209
213
 
210
214
  declare const BuilderVariableType: {
211
215
  readonly numericWithOptions: true;
@@ -567,7 +571,7 @@ interface BuilderRuleDto {
567
571
  readonly name: string;
568
572
  readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
569
573
  readonly excludeTags: ReadonlyArray<string>;
570
- readonly excludePages: ReadonlyArray<string>;
574
+ readonly excludePages: ReadonlyArray<PageID>;
571
575
  readonly jumpToPage: string | false;
572
576
  }
573
577
  declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
@@ -602,7 +606,7 @@ declare class PageActionManager {
602
606
  private readonly _initialSelection;
603
607
  readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
604
608
  constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
605
- getCurrentSelection(): ReadonlyArray<string>;
609
+ getCurrentSelection(): ReadonlyArray<PageID>;
606
610
  getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
607
611
  }
608
612
 
@@ -636,7 +640,7 @@ interface SchemaBuildOutput {
636
640
  declare class BuilderSchema {
637
641
  readonly id: SchemaID;
638
642
  name: string;
639
- private readonly _prefix;
643
+ readonly prefix: SchemaPrefix;
640
644
  baseHeight: number;
641
645
  baseWidth: number;
642
646
  backgroundColor: string;
@@ -644,7 +648,6 @@ declare class BuilderSchema {
644
648
  mainImage: ImageFile | false;
645
649
  private _rules;
646
650
  get rules(): ReadonlyArray<BuilderRule>;
647
- get prefix(): SchemaPrefixValue;
648
651
  private readonly _tagCollection;
649
652
  get tags(): ReadonlyArray<BuilderTag>;
650
653
  static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
@@ -684,4 +687,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
684
687
  toJson(): BuilderTextDto;
685
688
  }
686
689
 
687
- export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SchemaPrefix, SchemaPrefixValue, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile };
690
+ export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile, createRandomPrefix };
@@ -167,15 +167,27 @@ 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
- type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
177
- declare const VarID: {
178
- create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
173
+ declare const createRandomPrefix: <const P extends string>(length: number) => P;
174
+ declare class PagePrefix {
175
+ private _value;
176
+ static readonly MIN_LENGTH = 1;
177
+ private static randomLen;
178
+ static readonly MAX_LENGTH = 16;
179
+ static create: () => PagePrefix;
180
+ static fromString: (value: string) => PagePrefix | false;
181
+ static fromStringOrThrow: (value: string) => PagePrefixValue;
182
+ static castOrCreateRandom: (value: string) => PagePrefix;
183
+ static isValid: (prefix: string | 999) => prefix is PagePrefixValue;
184
+ get value(): PagePrefixValue;
185
+ set value(value: string);
186
+ private constructor();
187
+ }
188
+
189
+ type SchemaPrefixValue = string & {
190
+ __SCHEMA_PREFIX__: true;
179
191
  };
180
192
  declare class SchemaPrefix {
181
193
  private _value;
@@ -187,25 +199,17 @@ declare class SchemaPrefix {
187
199
  static fromString: (value: string) => SchemaPrefix | false;
188
200
  static castOrCreateRandom: (value: string) => SchemaPrefix;
189
201
  static isValid: (prefix: string | 999) => prefix is SchemaPrefixValue;
202
+ toJSON(): void;
190
203
  get value(): SchemaPrefixValue;
204
+ get isValid(): boolean;
191
205
  set value(value: string);
192
206
  private constructor();
193
207
  }
194
- declare class PagePrefix {
195
- private _value;
196
- static readonly MIN_LENGTH = 1;
197
- private static randomLen;
198
- static readonly MAX_LENGTH = 16;
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
- }
208
+
209
+ type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
210
+ declare const VarID: {
211
+ create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue) => VarID;
212
+ };
209
213
 
210
214
  declare const BuilderVariableType: {
211
215
  readonly numericWithOptions: true;
@@ -567,7 +571,7 @@ interface BuilderRuleDto {
567
571
  readonly name: string;
568
572
  readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
569
573
  readonly excludeTags: ReadonlyArray<string>;
570
- readonly excludePages: ReadonlyArray<string>;
574
+ readonly excludePages: ReadonlyArray<PageID>;
571
575
  readonly jumpToPage: string | false;
572
576
  }
573
577
  declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
@@ -602,7 +606,7 @@ declare class PageActionManager {
602
606
  private readonly _initialSelection;
603
607
  readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
604
608
  constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
605
- getCurrentSelection(): ReadonlyArray<string>;
609
+ getCurrentSelection(): ReadonlyArray<PageID>;
606
610
  getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
607
611
  }
608
612
 
@@ -636,7 +640,7 @@ interface SchemaBuildOutput {
636
640
  declare class BuilderSchema {
637
641
  readonly id: SchemaID;
638
642
  name: string;
639
- private readonly _prefix;
643
+ readonly prefix: SchemaPrefix;
640
644
  baseHeight: number;
641
645
  baseWidth: number;
642
646
  backgroundColor: string;
@@ -644,7 +648,6 @@ declare class BuilderSchema {
644
648
  mainImage: ImageFile | false;
645
649
  private _rules;
646
650
  get rules(): ReadonlyArray<BuilderRule>;
647
- get prefix(): SchemaPrefixValue;
648
651
  private readonly _tagCollection;
649
652
  get tags(): ReadonlyArray<BuilderTag>;
650
653
  static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
@@ -684,4 +687,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
684
687
  toJson(): BuilderTextDto;
685
688
  }
686
689
 
687
- export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SchemaPrefix, SchemaPrefixValue, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile };
690
+ export { AudioFile, BuilderCondition, BuilderConditionDto, BuilderConditionGroup, BuilderConditionGroupDto, BuilderMainImageDto, BuilderMainText, BuilderMainTextDto, BuilderMainVideoDto, BuilderOperator, BuilderOption, BuilderOptionDto, BuilderPage, BuilderPageDto, BuilderPageType, BuilderQuestion, BuilderQuestionDto, BuilderQuestionType, BuilderRule, BuilderRuleDto, BuilderSchema, BuilderSchemaDto, BuilderTag, BuilderTagDto, BuilderText, BuilderTextDto, BuilderVariable, BuilderVariableOption, ConditionGroupType, CustomVariable, ExcludeByPageAction, ExcludeByPageIdSelectItem, ExcludeByTagAction, ExcludeByTagSelectItem, ImageFile, JumpToActionManager, JumpToPageAction, JumpToPageSelectItem, MultiSelectItem, OperatorSelectItem, PageActionManager, PagePrefix, PagePrefixValue, QuestionVariable, RuleInput, RuleOptionSelectItem, RuleVariableSelectItem, SingleSelectItem, TagActionManager, TagCollection, VarID, VideoFile, createRandomPrefix };