/// /// import Parser = require('./Parser'); import Period = require('../unit/Period'); export declare type Callback = (period: Period.Period) => void; export interface ATPOptions { /** * Data attribute that is used to identify which elements need to be injected by countdown components, as well as * specify which type of component to inject. * * {@code
} will be injected with the amount of days left over for the * countdown. * * The injection is performed by replacing the innerHTML of the tagged elements with the (possibly zero-padded) * value, any previous content will be discarded. * * Defaults to {@see DOM_DISPLAY_ATTRIBUTE} */ displayAttribute?: string; /** * Data attribute that is used to identify which elements need to be hidden once a specific countdown component * becomes insignificant, as well as specify the exact component type to monitor for this event. * * For more information about significance {@link Period.TimeValue.significant}. * * {@code
} will be hidden when the countdown has less than 1 day remaining. * * The element is hidden by setting the css attribute 'display' to 'none', essentially removing the element from * the visual part of the DOM. * * Defaults to {@see DOM_HIDABLE_ATTRIBUTE} */ hidableAttribute?: string; /** * Modify the default zero-padding behavior for the various {@link Period.TimeKey} components. * If a key is set to true in this map, it will zero-pad the values in the template. * * Defaults to {@see DEFAULT_KEY_PADDING} */ zeroPadOverrides?: Dict; } export declare type SubCallback = (period: Period.Period) => boolean; /** * The AttributeTemplateParser builds a countdown using a pre-existing DOM structure containing specific data-attribute * values to mark which elements need to be injected with values for the countdown. * * data-{opts.displayAttribute} specifies injection of countdown components. {@see Period.TimeKey} * data-{opts.hidableAttribute} specifies elements that need to be hidden once a countdown component becomes * insignificant. */ export declare class AttributeTemplateParser implements Parser.Parser { private kDisplay; private kHidable; private padKeys; /** * Construct a data-attribute-based parser with the given options. * * @param {object} opts options to modify some parsing behaviours. */ constructor(opts: ATPOptions); build(roots: ArrayLikeShim): Callback; }