diff --git a/types/intrinsic-scale/index.d.ts b/types/intrinsic-scale/index.d.ts new file mode 100644 index 0000000000..7d61d2135e --- /dev/null +++ b/types/intrinsic-scale/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for intrinsic-scale 3.0 +// Project: https://github.com/bfred-it/intrinsic-scale#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +export function contain(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; +export function cover(parentWidth: number, parentHeight: number, childWidth: number, childHeight: number): IntrinsicScale; + +export interface IntrinsicScale { + width: number, + height: number, + x: number, + y: number +} diff --git a/types/intrinsic-scale/intrinsic-scale-tests.ts b/types/intrinsic-scale/intrinsic-scale-tests.ts new file mode 100644 index 0000000000..714620478d --- /dev/null +++ b/types/intrinsic-scale/intrinsic-scale-tests.ts @@ -0,0 +1,4 @@ +import { cover, contain } from "."; + +const intrinsicScale = cover(100, 100, 50, 50); +const { x, y, width, height } = contain(1,2,3,4); diff --git a/types/intrinsic-scale/tsconfig.json b/types/intrinsic-scale/tsconfig.json new file mode 100644 index 0000000000..8fcff6913d --- /dev/null +++ b/types/intrinsic-scale/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", + "intrinsic-scale-tests.ts" + ] +} \ No newline at end of file diff --git a/types/intrinsic-scale/tslint.json b/types/intrinsic-scale/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/intrinsic-scale/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }