Documentation
    Preparing search index...

    Interface WebRendererOptions<State>

    Options passed to the Renderer constructor by a webserver.

    interface WebRendererOptions<State> {
        indexDirectory: string;
        indexFileExtension?: string;
        moduleState?: State;
        path: string;
        pathParams?: Record<string, string | string[]>;
        rootDirectory: string;
    }

    Type Parameters

    • State

      An object that implements the State type will be passed to implementors of FuncStacheModule.

    Hierarchy (View Summary)

    Index

    Properties

    indexDirectory: string

    Path - relative to rootDirectory - to the directory that contains the funcstache module (index file) and mustache template file.

    indexFileExtension?: string

    The extension of the funcstache modules script files; if not provided it will default to "js". Useful in cases where the index files use "mjs", "cjs", or even "ts".

    moduleState?: State

    Data passed to the FuncStacheModule methods' options.state argument.

    path: string

    Path that the client (browser) has requested.

    pathParams?: Record<string, string | string[]>

    Parameters extracted from the request's URL path. When the template file path contains variables the value of those variables is extracted from the request's URL path. For example, if the URL is "/posts/123" and the template file path is "/posts/:id" then pathParams will have a property named id with the value "123".

    rootDirectory: string

    Fully qualified path to the directory that contains all the funcstache modules. Attempts to read files not contained in this directory will be ignored.