import type moment from 'moment'; import type Hexo from 'hexo'; interface Model { /** * Warehouse method * https://hexojs.github.io/warehouse/ */ toArray(): T[]; /** * Warehouse method * https://hexojs.github.io/warehouse/ */ count(): number; /** * Warehouse method * https://hexojs.github.io/warehouse/ */ forEach(fn: (v: T, i: number) => void): void; /** * Warehouse method * https://hexojs.github.io/warehouse/ */ filter(fn: (v: T, i: number) => boolean): Model; /** * Warehouse method * https://hexojs.github.io/warehouse/ */ map(fn: (v: T, i: number) => U): U[]; } interface Site { posts: Model; pages: Model; categories: Model; tags: Model; data: { [key: string]: any; }; } declare type HexoCssHelperParams = string | Record; declare type HexoJsHelperParams = string | Record; export interface ComponentProps { site: Site; page: Hexo.Locals.Page; config: TConfig; theme: TThemeConfig; path: string; url: string; env: Hexo['env']; body?: string; url_for(path: string, options?: { relative: boolean; }): string; relative_url(from: string, to: string): string; gravatar(email: string, options?: number | { s?: number; d?: string; f?: 'y' | undefined; r?: 'g' | 'pg' | 'r' | 'x'; }): string; full_url_for(path: string): string; css(css: HexoCssHelperParams | HexoCssHelperParams[]): string; js(js: HexoJsHelperParams | HexoJsHelperParams[]): string; link_to(path: string, title?: string, options?: { external?: boolean; class?: string; id?: string; }): string; mail_to(path: string, title?: string, options?: { class?: string; id?: string; subject?: string; cc?: string; bcc?: string; body?: string; }): string; image_tag(path: string, options?: { alt?: string; class?: string; id?: string; width?: string; height?: string; }): string; favicon_tag(path: string): string; feed_tag(path: string): string; is_current(path: string, strict?: boolean): boolean; is_home(): boolean; is_post(): boolean; is_page(): boolean; is_archive(): boolean; is_year(): boolean; is_month(): boolean; is_category(category?: string): boolean; is_tag(tag?: string): boolean; trim(str: string): string; strip_html(str: string): string; titlecase(str: string): string; markdown(str: string): string; render(str: string, engine: string): string; /** * * @param str * @param length default 80 */ word_wrap(str: string, length?: number): string; truncate(str: string, options?: { length?: number | undefined; omission?: string | undefined; separator?: string | undefined; }): string; escape_html(str: string): string; partial(layout: string, locals?: any, options?: { cache?: boolean; only?: boolean; }): string; fragment_cache(id: string, fn: () => string): string; date(date: number | string | Date, format?: string): string; date_xml(date: number | string | Date): string; time(time: number | string | Date, format?: string): string; full_date(date: number | string | Date, format?: string): string; moment: typeof moment; list_categories(categories: Model, options?: { orderby?: string; order?: 1 | -1; show_count?: boolean; style?: string; separator?: string; depth?: number; class?: string; transform?: (category: string) => string; suffix?: string; }): string; list_tags(tags: Model, options?: { orderby?: string; order?: 1 | -1; show_count?: boolean; style?: string; separator?: string; class?: string; transform?: (tag: string) => string; amount?: number; suffix?: string; }): string; list_archives(options?: { type?: 'yearly' | 'monthly'; order?: 1 | -1; show_count?: boolean; format?: string; style?: string; separator?: string; class?: string; transform?: (name: string) => string; }): string; list_posts(posts: Model, options?: { orderby?: string; order?: 1 | -1; style?: string; separator?: string; class?: string; amount?: number; transform?: (tag: string) => string; }): string; tagcloud(tags: Model, options?: { min_font?: number; max_font?: number; unit?: string; amount?: number; orderby?: string; order?: 1 | -1; color?: boolean; start_color?: string; end_color?: string; class?: string; level?: number; }): string; tag_cloud: ComponentProps['tagcloud']; paginator(options?: { base?: string; format?: string; total?: number; current?: number; prev_text?: string; next_text?: string; space?: string; prev_next?: boolean; end_size?: number; mid_size?: number; show_all?: boolean; escape?: boolean; }): string; search_form(options?: { class?: string; text?: string; button?: string | boolean; }): string; number_format(num: number, options?: { precision?: number; delimiter?: string; separator?: string; }): string; meta_generator(): string; open_graph(options?: any): string; toc(str: string, options?: { class?: string; list_number?: boolean; max_depth?: number; min_depth?: number; }): string; __(path: string): string; _p(path: string): string; } export {};