New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/hogan.js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/hogan.js

TypeScript definitions for hogan.js

  • 3.0.5
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
264K
decreased by-13.24%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/hogan.js

Summary

This package contains type definitions for hogan.js (http://twitter.github.com/hogan.js/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hogan.js.

index.d.ts

export interface Context {
    [key: string]: any;
}

export interface SectionTags {
    o: string;
    c: string;
}

export interface HoganOptions {
    asString?: boolean | undefined;
    sectionTags?: readonly SectionTags[] | undefined;
    delimiters?: string | undefined;
    disableLambda?: boolean | undefined;
}

export interface Token {
    tag: string;
    otag?: string | undefined;
    ctag?: string | undefined;
    i?: number | undefined;
    n?: string | undefined;
    text?: string | undefined;
}

export interface Leaf extends Token {
    end: number;
    nodes: Token[];
}

export type Tree = Leaf[];

export interface Partials {
    [symbol: string]: HoganTemplate;
}
declare class HoganTemplate {
    /**
     * Renders the template to a string.
     *
     * @param context - The data to render the template with.
     * @param partials - The partials to render the template with.
     * @param indent - The string to indent when rendering the template.
     * @returns A rendered template.
     */
    render(context: Context, partials?: Partials, indent?: string): string;
}

export { HoganTemplate as Template, HoganTemplate as template };

export function compile(
    text: string,
    options?: HoganOptions & { asString: false },
): HoganTemplate;
export function compile(
    text: string,
    options?: HoganOptions & { asString: true },
): string;
/**
 * Compiles templates to HoganTemplate objects, which have a render method.
 *
 * @param text - Raw mustache string to compile.
 * @param options - Options to use when compiling. See https://github.com/twitter/hogan.js#compilation-options.
 * @returns A HoganTemplate.
 */
export function compile(
    text: string,
    options?: HoganOptions,
): HoganTemplate | string;
/**
 * Scans templates returning an array of found tokens.
 *
 * @param text - Raw mustache string to scan.
 * @param delimiters - A string that overrides the default delimiters. Example: "<% %>".
 * @returns Found tokens.
 */
export function scan(text: string, delimiters?: string): Token[];
/**
 * Structures tokens into a tree.
 *
 * @param tokens - An array of scanned tokens.
 * @param text - Unused pass undefined.
 * @param options - Options to use when parsing. See https://github.com/twitter/hogan.js#compilation-options.
 * @returns The tree structure of the given tokens.
 */
export function parse(
    tokens: readonly Token[],
    text?: undefined,
    options?: HoganOptions,
): Tree;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Andrew Leedham.

FAQs

Package last updated on 21 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc