diff --git a/types/prismic-dom/index.d.ts b/types/prismic-dom/index.d.ts new file mode 100644 index 0000000000..2849cc7791 --- /dev/null +++ b/types/prismic-dom/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for prismic-dom 2.0 +// Project: https://github.com/prismicio/prismic-dom#readme +// Definitions by: Nick Whyte +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface RichText { + asHtml(richText: any, linkResolver?: (doc: any) => string): string; +} + +export const RichText: RichText; + +declare const _default: { RichText: RichText }; +export default _default; diff --git a/types/prismic-dom/prismic-dom-tests.ts b/types/prismic-dom/prismic-dom-tests.ts new file mode 100644 index 0000000000..598573cced --- /dev/null +++ b/types/prismic-dom/prismic-dom-tests.ts @@ -0,0 +1,3 @@ +import prismicDom = require("prismic-dom"); + +const rendered: string = prismicDom.RichText.asHtml({}); diff --git a/types/prismic-dom/tsconfig.json b/types/prismic-dom/tsconfig.json new file mode 100644 index 0000000000..0687e7ae0e --- /dev/null +++ b/types/prismic-dom/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prismic-dom-tests.ts" + ] +} diff --git a/types/prismic-dom/tslint.json b/types/prismic-dom/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/prismic-dom/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }