@acoustic-content-sdk/hbs-tooling 中文文档教程

发布于 4年前 浏览 10 更新于 3年前

npm

用于实现基于把手的工具功能的实用函数。

API Documentation

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

hbs-tooling package

实用函数来实现基于把手的工具功能。

Functions

Function Description
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

Variable Description
VERSION Version and build number of the package

Type Aliases

Type Alias Description
HandlebarsType Type definition on the handlebars API
TemplateDescriptor Representation of a file descriptor with templates for both the file name and the file content.
TemplateType Type definition on the handlebars template function that transforms a context into a markup string

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

createCompiler() function

构建车把编译器

签名:

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

Parameters

Parameter Type Description
aHandlebars HandlebarsType optionally a handlebars instance

返回:

UnaryFunction

>编译器

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

rxApplyTemplates() function

将模板应用于一组上下文

签名:

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

Parameters

Parameter Type Description
aCtx$ Observable&lt;any&gt; the set of contexts
aTemp$ Observable&lt;TemplateDescriptor&gt; the set of templates

返回:

Observable

the final data stream

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

rxReadTemplates() function

读取文件列表并将它们解释为模板,包括文件名和内容。

签名:

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

Parameters

Parameter Type Description
aDir string directory to start in
aHandlebars HandlebarsType optionally the handlebars instance

返回:

Observable

编译后的模板

主页 > @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;
}

首页 > @acoustic-content-sdk/hbs-tooling > HandlebarsType

HandlebarsType type

Type definition on the handlebars API

Signature:

export declare type HandlebarsType = ReturnType<typeof create>;

首页 > @acoustic-content-sdk/hbs-tooling > TemplateDescriptor

TemplateDescriptor type

文件描述符的表示,带有文件名和文件内容的模板。

Signature:

export declare type TemplateDescriptor = [TemplateType, TemplateType];

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

TemplateType type

将上下文转换为标记字符串的车把模板函数的类型定义

签名:

export declare type TemplateType = ReturnType<typeof compile>;

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

Function Description
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

Variable Description
VERSION Version and build number of the package

Type Aliases

Type Alias Description
HandlebarsType Type definition on the handlebars API
TemplateDescriptor Representation of a file descriptor with templates for both the file name and the file content.
TemplateType Type 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

Parameter Type Description
aHandlebars HandlebarsType optionally 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

Parameter Type Description
aCtx$ Observable&lt;any&gt; the set of contexts
aTemp$ Observable&lt;TemplateDescriptor&gt; 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

Parameter Type Description
aDir string directory to start in
aHandlebars HandlebarsType optionally 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>;
更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文