9.0.10076 • Published 4 years ago

@acoustic-content-sdk/hbs-tooling v9.0.10076

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

npm

Utility functions to implement handlebars based tooling functionality.

API Documentation

Home > @acoustic-content-sdk/hbs-tooling

hbs-tooling package

Utility functions to implement handlebars based tooling functionality.

Functions

FunctionDescription
createCompiler(aHandlebars)Constructs a handlebars compiler
rxApplyTemplates(aCtx$, aTemp$)Applies templates to a set of contexts
rxReadTemplates(aDir, aHandlebars)Reads a list of files and interprets them as templates, both in the filename and the content.

Variables

VariableDescription
VERSIONVersion and build number of the package

Type Aliases

Type AliasDescription
HandlebarsTypeType definition on the handlebars API
TemplateDescriptorRepresentation of a file descriptor with templates for both the file name and the file content.
TemplateTypeType definition on the handlebars template function that transforms a context into a markup string

Home > @acoustic-content-sdk/hbs-tooling > createCompiler

createCompiler() function

Constructs a handlebars compiler

Signature:

export declare function createCompiler(aHandlebars?: HandlebarsType): UnaryFunction<string, TemplateType>;

Parameters

ParameterTypeDescription
aHandlebarsHandlebarsTypeoptionally a handlebars instance

Returns:

UnaryFunction<string, TemplateType>

the compiler

Home > @acoustic-content-sdk/hbs-tooling > rxApplyTemplates

rxApplyTemplates() function

Applies templates to a set of contexts

Signature:

export declare function rxApplyTemplates(aCtx$: Observable<any>, aTemp$: Observable<TemplateDescriptor>): Observable<FileDescriptor<string>>;

Parameters

ParameterTypeDescription
aCtx$Observable<any>the set of contexts
aTemp$Observable<TemplateDescriptor>the set of templates

Returns:

Observable<FileDescriptor<string>>

the final data stream

Home > @acoustic-content-sdk/hbs-tooling > rxReadTemplates

rxReadTemplates() function

Reads a list of files and interprets them as templates, both in the filename and the content.

Signature:

export declare function rxReadTemplates(aDir: string, aHandlebars?: HandlebarsType): Observable<TemplateDescriptor>;

Parameters

ParameterTypeDescription
aDirstringdirectory to start in
aHandlebarsHandlebarsTypeoptionally the handlebars instance

Returns:

Observable<TemplateDescriptor>

the compiled templates

Home > @acoustic-content-sdk/hbs-tooling > VERSION

VERSION variable

Version and build number of the package

Signature:

VERSION: {
    version: {
        major: string;
        minor: string;
        patch: string;
        branch: string;
    };
    build: Date;
}

Home > @acoustic-content-sdk/hbs-tooling > HandlebarsType

HandlebarsType type

Type definition on the handlebars API

Signature:

export declare type HandlebarsType = ReturnType<typeof create>;

Home > @acoustic-content-sdk/hbs-tooling > TemplateDescriptor

TemplateDescriptor type

Representation of a file descriptor with templates for both the file name and the file content.

Signature:

export declare type TemplateDescriptor = [TemplateType, TemplateType];

Home > @acoustic-content-sdk/hbs-tooling > TemplateType

TemplateType type

Type definition on the handlebars template function that transforms a context into a markup string

Signature:

export declare type TemplateType = ReturnType<typeof compile>;