@types/prismic-dom
TypeScript icon, indicating that this package has built-in type declarations

2.1.4 • Public • Published

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

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, Siggy Bilstein, Douglas Nomizo, and Henry Myers.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/prismic-dom

Weekly Downloads

7,726

Version

2.1.4

License

MIT

Unpacked Size

5.62 kB

Total Files

5

Last publish

Collaborators

  • types