Skip to main content

Class: ChecklistDOMParser<I>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:138

A parser of checklist definitions from DOM elements.

Type Parameters

Type ParameterDefault typeDescription
I extends BaseChecklistItemTypeDefMapChecklistItemTypeDefMapA map from checklist item types to checklist item definitions to which the definitions parsed by the parser conform. Defaults to ChecklistItemTypeDefMap. Subclasses that parse item definitions that do not conform to to the default map should override this type parameter as appropriate.

Constructors

Constructor

new ChecklistDOMParser<I>(): ChecklistDOMParser<I>

Returns

ChecklistDOMParser<I>

Methods

protected auditBranchItemLinks(set, group, list, branch, item, options): void

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:704

Audits links contained in a parsed branch checklist item definition.

Parameters

ParameterTypeDescription
setChecklistSetDef<I>The set containing the group to audit.
groupChecklistGroupDef<I>The group containing the item to audit.
listChecklistListDef<I>The list containing the item to audit.
branchundefined | ChecklistBranchDef<I, unknown>The branch containing the item to audit, or undefined if the item is not in a branch.
itemI[Branch]The item to audit.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

void


auditLinkItemTarget()

protected auditLinkItemTarget(set, group, list, branch, item, options): void

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:729

Audits links contained in a parsed link checklist item definition.

Parameters

ParameterTypeDescription
setChecklistSetDef<I>The set containing the group to audit.
groupChecklistGroupDef<I>The group containing the item to audit.
listChecklistListDef<I>The list containing the item to audit.
branchundefined | ChecklistBranchDef<I, unknown>The branch containing the item to audit, or undefined if the item is not in a branch.
itemI[Link]The item to audit.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

void


auditLinksInGroup()

protected auditLinksInGroup(set, group, options): void

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:638

Audits links contained in a parsed checklist group definition.

Parameters

ParameterTypeDescription
setChecklistSetDef<I>The set containing the group to audit.
groupChecklistGroupDef<I>The group to audit.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

void


auditLinksInItem()

protected auditLinksInItem(set, group, list, branch, item, options): void

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:677

Audits links contained in a parsed checklist item definition.

Parameters

ParameterTypeDescription
setChecklistSetDef<I>The set containing the group to audit.
groupChecklistGroupDef<I>The group containing the item to audit.
listChecklistListDef<I>The list containing the item to audit.
branchundefined | ChecklistBranchDef<I, unknown>The branch containing the item to audit, or undefined if the item is not in a branch.
itemChecklistItemDef<I>The item to audit.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

void


auditLinksInList()

protected auditLinksInList(set, group, list, options): void

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:651

Audits links contained in a parsed checklist list definition.

Parameters

ParameterTypeDescription
setChecklistSetDef<I>The set containing the group to audit.
groupChecklistGroupDef<I>The group containing the list to audit.
listChecklistListDef<I>The list to audit.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

void


auditLinksInSet()

protected auditLinksInSet(set, options): void

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:626

Audits links contained in a parsed checklist set definition.

Parameters

ParameterTypeDescription
setChecklistSetDef<I>The set to audit.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

void


parse()

Call Signature

parse(element): ChecklistSetDef<I>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:147

Parses the checklist set definition specified by a DOM element.

Parameters
ParameterTypeDescription
elementElementThe element to parse.
Returns

ChecklistSetDef<I>

The checklist set definition parsed from the specified element.

Throws

Error if the parsing operation encounters an unrecoverable syntax error or if the errorInsteadOfDiscard option is enabled and the operation encounters a syntax error that would normally cause a definition to be discarded.

Call Signature

parse<O>(element, options): ChecklistSetDef<I, TypeOfParseOptionsSetMetadata<O>, TypeOfParseOptionsGroupMetadata<O>, TypeOfParseOptionsListMetadata<O>, TypeOfParseOptionsBranchMetadata<O>>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:159

Parses the checklist set definition specified by a DOM element.

Type Parameters
Type Parameter
O extends ChecklistDOMParserParseOptions<I, any, any, any, any>
Parameters
ParameterTypeDescription
elementElementThe element to parse.
optionsReadonly<O>Options to apply to the parsing operation.
Returns

ChecklistSetDef<I, TypeOfParseOptionsSetMetadata<O>, TypeOfParseOptionsGroupMetadata<O>, TypeOfParseOptionsListMetadata<O>, TypeOfParseOptionsBranchMetadata<O>>

The checklist set definition parsed from the specified element.

Throws

Error if the parsing operation encounters an unrecoverable syntax error or if the errorInsteadOfDiscard option is enabled and the operation encounters a syntax error that would normally cause a definition to be discarded.


parseActionableItemDef()

protected parseActionableItemDef(element, groupName, listName, branchName, options): undefined | I[Actionable]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:401

Parses an actionable checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | I[Actionable]

The actionable checklist item definition parsed from the specified element, or undefined if the definition was discarded.


parseBranchDef()

protected parseBranchDef(element, groupName, listName, options): undefined | ChecklistBranchDef<I, unknown>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:291

Parses a checklist branch definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the branch is to be parsed.
listNamestringThe name of the checklist list for which the branch is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | ChecklistBranchDef<I, unknown>

The checklist branch definition parsed from the specified element, or undefined if the definition was discarded.


parseBranchItemDef()

protected parseBranchItemDef(element, groupName, listName, branchName, options): undefined | I[Branch]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:436

Parses a branch checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | I[Branch]

The branch checklist item definition parsed from the specified element, or undefined if the definition was discarded.


parseGroupDef()

protected parseGroupDef(element, options): undefined | ChecklistGroupDef<I, unknown, unknown, unknown>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:208

Parses a checklist group definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | ChecklistGroupDef<I, unknown, unknown, unknown>

The checklist group definition parsed from the specified element, or undefined if the definition was discarded.


parseItemDef()

protected parseItemDef(element, groupName, listName, branchName, options): undefined | ChecklistItemDef<I>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:359

Parses a checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | ChecklistItemDef<I>

The checklist item definition parsed from the specified element, or undefined if the definition was discarded.


parseItemDefArray()

protected parseItemDefArray(element, groupName, listName, branchName, options): ChecklistItemDef<I>[]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:330

Parses an array of item definitions from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item array is to be parsed.
listNamestringThe name of the checklist list for which the item array is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item array is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

ChecklistItemDef<I>[]

The checklist item definition array parsed from the specified element.


parseLinkItemDef()

protected parseLinkItemDef(element, groupName, listName, branchName, options): undefined | I[Link]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:500

Parses a link checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | I[Link]

The link checklist item definition parsed from the specified element, or undefined if the definition was discarded.


parseListDef()

protected parseListDef(element, groupName, options): undefined | ChecklistListDef<I, unknown, unknown>

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:246

Parses a checklist list definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the list is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | ChecklistListDef<I, unknown, unknown>

The checklist list definition parsed from the specified element, or undefined if the definition was discarded.


parseNoteItemDef()

protected parseNoteItemDef(element, groupName, listName, branchName, options): undefined | I[Note]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:534

Parses a note checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | I[Note]

The note checklist item definition parsed from the specified element, or undefined if the definition was discarded.


parseSpacerItemDef()

protected parseSpacerItemDef(element, groupName, listName, branchName, options): undefined | I[Spacer]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:596

Parses a spacer checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | I[Spacer]

The spacer checklist item definition parsed from the specified element, or undefined if the definition was discarded.


parseTitleItemDef()

protected parseTitleItemDef(element, groupName, listName, branchName, options): undefined | I[Title]

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:565

Parses a title checklist item definition from a DOM element.

Parameters

ParameterTypeDescription
elementElementThe element to parse.
groupNamestringThe name of the checklist group for which the item is to be parsed.
listNamestringThe name of the checklist list for which the item is to be parsed.
branchNameundefined | stringThe name of the checklist branch for which the item is to be parsed.
optionsChecklistDOMParseOptionsToUse<I>The options to use when parsing.

Returns

undefined | I[Title]

The title checklist item definition parsed from the specified element, or undefined if the definition was discarded.


tryParseTextAsJSON()

static tryParseTextAsJSON(text): string

Defined in: src/sdk/checklist/ChecklistDOMParser.ts:775

Attempts to parse a text string as a JSON-formatted string.

Parameters

ParameterTypeDescription
textstringThe text string to parse.

Returns

string

The string parsed from the text string, or the original text string if it did not encode a JSON-formatted string.