@media-quest/builder 0.0.9 → 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;
@@ -299,12 +303,14 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
299
303
  interface ExcludeByPageAction {
300
304
  readonly kind: "exclude-by-pageId";
301
305
  readonly pageId: PageID;
306
+ readonly pagePrefix: PagePrefixValue;
302
307
  readonly mainText: string;
303
308
  readonly pageNumber: number;
304
309
  }
305
310
  interface JumpToPageAction {
306
311
  readonly kind: "jump-to-page";
307
312
  readonly pageId: PageID;
313
+ readonly pagePrefix: PagePrefixValue;
308
314
  readonly mainText: string;
309
315
  readonly pageNumber: number;
310
316
  }
@@ -565,7 +571,7 @@ interface BuilderRuleDto {
565
571
  readonly name: string;
566
572
  readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
567
573
  readonly excludeTags: ReadonlyArray<string>;
568
- readonly excludePages: ReadonlyArray<string>;
574
+ readonly excludePages: ReadonlyArray<PageID>;
569
575
  readonly jumpToPage: string | false;
570
576
  }
571
577
  declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
@@ -600,7 +606,7 @@ declare class PageActionManager {
600
606
  private readonly _initialSelection;
601
607
  readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
602
608
  constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
603
- getCurrentSelection(): ReadonlyArray<string>;
609
+ getCurrentSelection(): ReadonlyArray<PageID>;
604
610
  getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
605
611
  }
606
612
 
@@ -634,7 +640,7 @@ interface SchemaBuildOutput {
634
640
  declare class BuilderSchema {
635
641
  readonly id: SchemaID;
636
642
  name: string;
637
- private readonly _prefix;
643
+ readonly prefix: SchemaPrefix;
638
644
  baseHeight: number;
639
645
  baseWidth: number;
640
646
  backgroundColor: string;
@@ -642,7 +648,6 @@ declare class BuilderSchema {
642
648
  mainImage: ImageFile | false;
643
649
  private _rules;
644
650
  get rules(): ReadonlyArray<BuilderRule>;
645
- get prefix(): SchemaPrefixValue;
646
651
  private readonly _tagCollection;
647
652
  get tags(): ReadonlyArray<BuilderTag>;
648
653
  static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
@@ -682,4 +687,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
682
687
  toJson(): BuilderTextDto;
683
688
  }
684
689
 
685
- 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;
@@ -299,12 +303,14 @@ declare class BuilderPage extends BuilderObject<"builder-page", BuilderPageDto>
299
303
  interface ExcludeByPageAction {
300
304
  readonly kind: "exclude-by-pageId";
301
305
  readonly pageId: PageID;
306
+ readonly pagePrefix: PagePrefixValue;
302
307
  readonly mainText: string;
303
308
  readonly pageNumber: number;
304
309
  }
305
310
  interface JumpToPageAction {
306
311
  readonly kind: "jump-to-page";
307
312
  readonly pageId: PageID;
313
+ readonly pagePrefix: PagePrefixValue;
308
314
  readonly mainText: string;
309
315
  readonly pageNumber: number;
310
316
  }
@@ -565,7 +571,7 @@ interface BuilderRuleDto {
565
571
  readonly name: string;
566
572
  readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
567
573
  readonly excludeTags: ReadonlyArray<string>;
568
- readonly excludePages: ReadonlyArray<string>;
574
+ readonly excludePages: ReadonlyArray<PageID>;
569
575
  readonly jumpToPage: string | false;
570
576
  }
571
577
  declare class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
@@ -600,7 +606,7 @@ declare class PageActionManager {
600
606
  private readonly _initialSelection;
601
607
  readonly selectItems: ReadonlyArray<ExcludeByPageIdSelectItem>;
602
608
  constructor(validOptions: RuleInput["_pageIdActions"], initialSelection: ReadonlyArray<string>);
603
- getCurrentSelection(): ReadonlyArray<string>;
609
+ getCurrentSelection(): ReadonlyArray<PageID>;
604
610
  getEngineAction(): ReadonlyArray<ExcludeByPageAction>;
605
611
  }
606
612
 
@@ -634,7 +640,7 @@ interface SchemaBuildOutput {
634
640
  declare class BuilderSchema {
635
641
  readonly id: SchemaID;
636
642
  name: string;
637
- private readonly _prefix;
643
+ readonly prefix: SchemaPrefix;
638
644
  baseHeight: number;
639
645
  baseWidth: number;
640
646
  backgroundColor: string;
@@ -642,7 +648,6 @@ declare class BuilderSchema {
642
648
  mainImage: ImageFile | false;
643
649
  private _rules;
644
650
  get rules(): ReadonlyArray<BuilderRule>;
645
- get prefix(): SchemaPrefixValue;
646
651
  private readonly _tagCollection;
647
652
  get tags(): ReadonlyArray<BuilderTag>;
648
653
  static create(id: SchemaID, name: string, prefix: SchemaPrefixValue): BuilderSchema;
@@ -682,4 +687,4 @@ declare class BuilderText extends BuilderObject<'builder-text', BuilderTextDto>
682
687
  toJson(): BuilderTextDto;
683
688
  }
684
689
 
685
- 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 };