prismic-dom: Add initial typings

This commit is contained in:
Nick Whyte
2018-03-09 12:26:09 +11:00
parent df7f63d0a7
commit 3938139029
4 changed files with 34 additions and 0 deletions

8
types/prismic-dom/index.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for prismic-dom 2.0
// Project: https://github.com/prismicio/prismic-dom#readme
// Definitions by: Nick Whyte <https://github.com/nickw444/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export class RichText {
static asHtml(richText: any, linkResolver?: (doc: any) => string): string;
}

View File

@@ -0,0 +1,3 @@
import prismicDom = require("prismic-dom");
let rendered: string = prismicDom.RichText.asHtml({});

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"prismic-dom-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }