From af0c902725e9cd72c845f110009f6f8af598f3bd Mon Sep 17 00:00:00 2001 From: Daniel Waxweiler Date: Thu, 7 Jun 2018 09:53:26 +0200 Subject: [PATCH 1/2] initial release --- types/tinycon/index.d.ts | 24 ++++++++++++++++++++++++ types/tinycon/tinycon-tests.ts | 11 +++++++++++ types/tinycon/tsconfig.json | 23 +++++++++++++++++++++++ types/tinycon/tslint.json | 7 +++++++ 4 files changed, 65 insertions(+) create mode 100644 types/tinycon/index.d.ts create mode 100644 types/tinycon/tinycon-tests.ts create mode 100644 types/tinycon/tsconfig.json create mode 100644 types/tinycon/tslint.json diff --git a/types/tinycon/index.d.ts b/types/tinycon/index.d.ts new file mode 100644 index 0000000000..9393a1aa6f --- /dev/null +++ b/types/tinycon/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for tinycon 0.6 +// Project: https://github.com/tommoor/tinycon +// Definitions by: Daniel Waxweiler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Tinycon { + function setBubble(count: number): void; + + function setOptions(options: TinyconOptions): void; + + interface TinyconOptions { + abbreviate?: boolean; + background?: string; + color?: string; + fallback?: boolean; + font?: string; + height?: number; + width?: number; + } +} + +declare module "tinycon" { + export = Tinycon; +} diff --git a/types/tinycon/tinycon-tests.ts b/types/tinycon/tinycon-tests.ts new file mode 100644 index 0000000000..3004a503ef --- /dev/null +++ b/types/tinycon/tinycon-tests.ts @@ -0,0 +1,11 @@ +Tinycon.setOptions({ + abbreviate: false, + background: '#549A2F', + color: '#ffffff', + fallback: true, + font: '10px arial', + height: 9, + width: 7 +}); + +Tinycon.setBubble(7); diff --git a/types/tinycon/tsconfig.json b/types/tinycon/tsconfig.json new file mode 100644 index 0000000000..2410f4bd8a --- /dev/null +++ b/types/tinycon/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", + "tinycon-tests.ts" + ] +} diff --git a/types/tinycon/tslint.json b/types/tinycon/tslint.json new file mode 100644 index 0000000000..bd3bb78849 --- /dev/null +++ b/types/tinycon/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-declare-current-package": false, + "no-single-declare-module": false + } +} From e7e65dabaa40686c001b9aece81446998dadaaaa Mon Sep 17 00:00:00 2001 From: Daniel Waxweiler Date: Wed, 13 Jun 2018 15:25:07 +0200 Subject: [PATCH 2/2] remove module declaration and namespace --- types/tinycon/index.d.ts | 26 ++++++++++---------------- types/tinycon/tinycon-tests.ts | 2 ++ types/tinycon/tslint.json | 6 +----- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/types/tinycon/index.d.ts b/types/tinycon/index.d.ts index 9393a1aa6f..3f385603cc 100644 --- a/types/tinycon/index.d.ts +++ b/types/tinycon/index.d.ts @@ -3,22 +3,16 @@ // Definitions by: Daniel Waxweiler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace Tinycon { - function setBubble(count: number): void; +export function setBubble(count: number): void; - function setOptions(options: TinyconOptions): void; +export function setOptions(options: TinyconOptions): void; - interface TinyconOptions { - abbreviate?: boolean; - background?: string; - color?: string; - fallback?: boolean; - font?: string; - height?: number; - width?: number; - } -} - -declare module "tinycon" { - export = Tinycon; +export interface TinyconOptions { + abbreviate?: boolean; + background?: string; + color?: string; + fallback?: boolean; + font?: string; + height?: number; + width?: number; } diff --git a/types/tinycon/tinycon-tests.ts b/types/tinycon/tinycon-tests.ts index 3004a503ef..b4bcc304ac 100644 --- a/types/tinycon/tinycon-tests.ts +++ b/types/tinycon/tinycon-tests.ts @@ -1,3 +1,5 @@ +import * as Tinycon from 'tinycon'; + Tinycon.setOptions({ abbreviate: false, background: '#549A2F', diff --git a/types/tinycon/tslint.json b/types/tinycon/tslint.json index bd3bb78849..f93cf8562a 100644 --- a/types/tinycon/tslint.json +++ b/types/tinycon/tslint.json @@ -1,7 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-declare-current-package": false, - "no-single-declare-module": false - } + "extends": "dtslint/dt.json" }