Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Used for parsing different types of serialized selector data into Selector instances.

    The SelectorFactory must be configured with SelectorDataParsers and FragmentSelectorParser in order to support different selector formats.

    For example, to create a SelectorFactory that can parse EPUB CFI selectors, do the following

    const selectorFactory = new SelectorFactory([
    new EpubCfiFragmentSelectorParser()
    ])
    const parsedEpubCfiSelector = selectorFactory.createFromFragment('epubcfi(/6/2!/4)');

    If you have a serialized Locator you can use a LocatorFactory to parse it. You can use ReaderPublication.getLocatorFactory() to get a pre-configured LocatorFactory and SelectorFactory for that publication type.

    Implements

    Constructors

    Methods

    • Parses a fragment selector string into an ISelector instance. The types of selectors that can be parsed depends on which selector parser implementations this factory was created with.

      If the fragment selector format is unknown, an UnknownFragmentSelector instance is returned containing the fragment string.

      Parameters

      • fragment: string

        The fragment selector to parse.

      • OptionalrefinementSelectors: ISelector[]

        Additional refinement selectors if any.

      Returns ISelector