UNPKG

@types/prismic-dom

Version:
76 lines (63 loc) 1.99 kB
# Installation > `npm install --save @types/prismic-dom` # Summary This package contains type definitions for prismic-dom (https://github.com/prismicio/prismic-dom#readme). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prismic-dom. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prismic-dom/index.d.ts) ````ts interface Elements { heading1: "heading1"; heading2: "heading2"; heading3: "heading3"; heading4: "heading4"; heading5: "heading5"; heading6: "heading6"; paragraph: "paragraph"; preformatted: "preformatted"; strong: "strong"; em: "em"; listItem: "list-item"; oListItem: "o-list-item"; list: "group-list-item"; oList: "group-o-list-item"; image: "image"; embed: "embed"; hyperlink: "hyperlink"; label: "label"; span: "span"; } type ElementType = Elements[keyof Elements]; type HTMLSerializer<T> = ( type: ElementType, element: any, text: string | null, children: T[], index: number, ) => T; interface RichText { asHtml( richText: any, linkResolver?: (doc: any) => string, serializer?: HTMLSerializer<string>, ): string; asText(richText: any, joinString?: string): string; Elements: Elements; } interface Link { url(link: any, linkResolver?: (doc: any) => string): string; } export const RichText: RichText; export const Link: Link; export const HTMLSerializer: HTMLSerializer<string>; declare const _default: { RichText: RichText; Link: Link; }; export default _default; ```` ### Additional Details * Last updated: Tue, 07 Nov 2023 09:09:39 GMT * Dependencies: none # Credits These definitions were written by [Nick Whyte](https://github.com/nickw444), [Siggy Bilstein](https://github.com/sbilstein), [Douglas Nomizo](https://github.com/douglasnomizo), and [Henry Myers](https://github.com/henrymyers).