mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #33280 from saboya/word-extractor-typings
Adding types for word-extractor
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for word-extractor 0.3
|
||||
// Project: https://github.com/morungos/node-word-extractor
|
||||
// Definitions by: Rodrigo Saboya <https://github.com/saboya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class WordExtractor {
|
||||
extract(documentPath: string): Promise<WordExtractor.Document>;
|
||||
}
|
||||
|
||||
export = WordExtractor;
|
||||
|
||||
declare namespace WordExtractor {
|
||||
class Document {
|
||||
getBody(): string;
|
||||
getFootnotes(): string;
|
||||
getHeaders(): string;
|
||||
getAnnotations(): string;
|
||||
getEndNotes(): string;
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"word-extractor-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,13 @@
|
||||
import WordExtractor = require("word-extractor");
|
||||
|
||||
const extractor = new WordExtractor();
|
||||
|
||||
let temp: string;
|
||||
|
||||
const doc = extractor.extract('/path/to/file.doc').then(document => {
|
||||
temp = document.getBody();
|
||||
temp = document.getAnnotations();
|
||||
temp = document.getEndNotes();
|
||||
temp = document.getFootnotes();
|
||||
temp = document.getHeaders();
|
||||
});
|
||||
Reference in New Issue
Block a user