From 79f295972398f1c823ab7040937e6ed12e7280f4 Mon Sep 17 00:00:00 2001 From: Jamie Davies Date: Tue, 12 Jun 2018 14:16:01 +0100 Subject: [PATCH] Added types for runes --- types/runes/index.d.ts | 11 +++++++++++ types/runes/runes-tests.ts | 4 ++++ types/runes/tsconfig.json | 23 +++++++++++++++++++++++ types/runes/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/runes/index.d.ts create mode 100644 types/runes/runes-tests.ts create mode 100644 types/runes/tsconfig.json create mode 100644 types/runes/tslint.json diff --git a/types/runes/index.d.ts b/types/runes/index.d.ts new file mode 100644 index 0000000000..09e1330c35 --- /dev/null +++ b/types/runes/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for runes 0.4 +// Project: https://github.com/dotcypress/runes +// Definitions by: Jamie Davies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function runes(text: string): string[]; +declare namespace runes { + function substr(text: string, index: number): string; +} + +export = runes; diff --git a/types/runes/runes-tests.ts b/types/runes/runes-tests.ts new file mode 100644 index 0000000000..767be2dccb --- /dev/null +++ b/types/runes/runes-tests.ts @@ -0,0 +1,4 @@ +import runes = require('runes'); + +runes('hello world 😁'); +runes.substr('hello world 😁', 1); diff --git a/types/runes/tsconfig.json b/types/runes/tsconfig.json new file mode 100644 index 0000000000..87ca6191c5 --- /dev/null +++ b/types/runes/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "runes-tests.ts" + ] +} diff --git a/types/runes/tslint.json b/types/runes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/runes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }