From 60fa737201c97ae15219b9082ad9885068707002 Mon Sep 17 00:00:00 2001 From: David Paz Date: Fri, 28 Jul 2017 15:49:01 +0200 Subject: [PATCH 1/8] Add type definition for jquery.stickem plugin --- types/jquery.stickem/index.d.ts | 53 ++++++++++++++++++++ types/jquery.stickem/jquery.stickem-tests.ts | 19 +++++++ types/jquery.stickem/tsconfig.json | 21 ++++++++ 3 files changed, 93 insertions(+) create mode 100644 types/jquery.stickem/index.d.ts create mode 100644 types/jquery.stickem/jquery.stickem-tests.ts create mode 100644 types/jquery.stickem/tsconfig.json diff --git a/types/jquery.stickem/index.d.ts b/types/jquery.stickem/index.d.ts new file mode 100644 index 0000000000..8a39a7dc87 --- /dev/null +++ b/types/jquery.stickem/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for jquery.stickem.js 1.4.1 +// Project: https://github.com/davist11/jQuery-Stickem +// Definitions by: David Paz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface StickemSettings { + /** + * selector for element to make sticky + */ + item?: string; + + /** + * selector for content container, sizes matched with `item` + */ + container?: string; + + /** + * css class used to apply + */ + stickClass?: string; + + /** + * css class used to apply when ending sticky + */ + endStickClass?: string; + + /** + * offset to use for the sticky element in the parent element + */ + offset?: number | string; + + /** + * where to place sticky element + */ + start?: number | string; + + /** + * Callback to execute when in stick state + */ + onStick?: Function, + + /** + * Callback to execute when getting out of stick state + */ + onUnstick?: Function +} + +interface JQuery { + stickem(settings?: StickemSettings): JQuery; +} diff --git a/types/jquery.stickem/jquery.stickem-tests.ts b/types/jquery.stickem/jquery.stickem-tests.ts new file mode 100644 index 0000000000..37fb586280 --- /dev/null +++ b/types/jquery.stickem/jquery.stickem-tests.ts @@ -0,0 +1,19 @@ +// without options +$('div').stickem(); + +jQuery('div').stickem(); + +// with options +$('div').stickem({item: + '.stickem', + container: '.stickem-container', + stickClass: 'stickit', + endStickClass: 'stickit-end' +}); + +jQuery('div').stickem({ + item: '.stickem', + container: '.stickem-container', + stickClass: 'stickit', + endStickClass: 'stickit-end' +}); \ No newline at end of file diff --git a/types/jquery.stickem/tsconfig.json b/types/jquery.stickem/tsconfig.json new file mode 100644 index 0000000000..57b4feb0b6 --- /dev/null +++ b/types/jquery.stickem/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "types", + "typeRoots": ["types"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery.stickem-tests.ts" + ] +} \ No newline at end of file From b2a739c82b974078862c9ed092cab1b02bfda103 Mon Sep 17 00:00:00 2001 From: David Paz Date: Fri, 28 Jul 2017 16:53:06 +0200 Subject: [PATCH 2/8] Fix path in tsconfig.json --- types/jquery.stickem/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jquery.stickem/tsconfig.json b/types/jquery.stickem/tsconfig.json index 57b4feb0b6..dd76da3bf5 100644 --- a/types/jquery.stickem/tsconfig.json +++ b/types/jquery.stickem/tsconfig.json @@ -8,8 +8,8 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, - "baseUrl": "types", - "typeRoots": ["types"], + "baseUrl": "../", + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true From 27a54135847e4df91385d272f15bb4db6b301172 Mon Sep 17 00:00:00 2001 From: David Paz Date: Fri, 28 Jul 2017 17:23:03 +0200 Subject: [PATCH 3/8] Add strict null check --- types/jquery.stickem/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jquery.stickem/tsconfig.json b/types/jquery.stickem/tsconfig.json index dd76da3bf5..885a76e305 100644 --- a/types/jquery.stickem/tsconfig.json +++ b/types/jquery.stickem/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": ["../"], "types": [], From 4bb00c69f459735a65c721d8f8114d44c69718d6 Mon Sep 17 00:00:00 2001 From: David Paz Date: Wed, 7 Feb 2018 23:20:26 +0100 Subject: [PATCH 4/8] Remove path from version --- types/jquery.stickem/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jquery.stickem/index.d.ts b/types/jquery.stickem/index.d.ts index 8a39a7dc87..6b223805ec 100644 --- a/types/jquery.stickem/index.d.ts +++ b/types/jquery.stickem/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.stickem.js 1.4.1 +// Type definitions for jquery.stickem.js 1.4 // Project: https://github.com/davist11/jQuery-Stickem // Definitions by: David Paz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From be2be3cfbf4c7bab944820a905798b763cf0c7c8 Mon Sep 17 00:00:00 2001 From: David Paz Date: Wed, 7 Feb 2018 23:31:53 +0100 Subject: [PATCH 5/8] Add missing tslint.json file --- types/jquery.stickem/tslint.json | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 types/jquery.stickem/tslint.json diff --git a/types/jquery.stickem/tslint.json b/types/jquery.stickem/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/jquery.stickem/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} From 5cdbe8d38fa3ca1b588bfff699bcf48d4495cfd7 Mon Sep 17 00:00:00 2001 From: David Paz Date: Wed, 7 Feb 2018 23:57:06 +0100 Subject: [PATCH 6/8] Add missing compilerOptions["esModuleInterop"] === true --- types/jquery.stickem/tsconfig.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/types/jquery.stickem/tsconfig.json b/types/jquery.stickem/tsconfig.json index 885a76e305..7e87cb9015 100644 --- a/types/jquery.stickem/tsconfig.json +++ b/types/jquery.stickem/tsconfig.json @@ -7,15 +7,19 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, + "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jquery.stickem-tests.ts" ] -} \ No newline at end of file +} From b38c81550b104cea4c0d5af558cf16e06f66ae96 Mon Sep 17 00:00:00 2001 From: David Paz Date: Fri, 9 Feb 2018 21:57:42 +0100 Subject: [PATCH 7/8] Fix errors in configuration --- types/jquery.stickem/tsconfig.json | 2 +- types/jquery.stickem/tslint.json | 78 +----------------------------- 2 files changed, 2 insertions(+), 78 deletions(-) diff --git a/types/jquery.stickem/tsconfig.json b/types/jquery.stickem/tsconfig.json index 7e87cb9015..120d2c1526 100644 --- a/types/jquery.stickem/tsconfig.json +++ b/types/jquery.stickem/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/jquery.stickem/tslint.json b/types/jquery.stickem/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jquery.stickem/tslint.json +++ b/types/jquery.stickem/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } From 53db5de738330b2bbea30d0f5fac1fd88a786afa Mon Sep 17 00:00:00 2001 From: David Paz Date: Fri, 9 Feb 2018 22:05:00 +0100 Subject: [PATCH 8/8] Fix errors in source code for stcikem --- types/jquery.stickem/index.d.ts | 4 ++-- types/jquery.stickem/jquery.stickem-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jquery.stickem/index.d.ts b/types/jquery.stickem/index.d.ts index 6b223805ec..50e759635e 100644 --- a/types/jquery.stickem/index.d.ts +++ b/types/jquery.stickem/index.d.ts @@ -40,12 +40,12 @@ interface StickemSettings { /** * Callback to execute when in stick state */ - onStick?: Function, + onStick?: () => void; /** * Callback to execute when getting out of stick state */ - onUnstick?: Function + onUnstick?: () => void; } interface JQuery { diff --git a/types/jquery.stickem/jquery.stickem-tests.ts b/types/jquery.stickem/jquery.stickem-tests.ts index 37fb586280..572bdf7773 100644 --- a/types/jquery.stickem/jquery.stickem-tests.ts +++ b/types/jquery.stickem/jquery.stickem-tests.ts @@ -16,4 +16,4 @@ jQuery('div').stickem({ container: '.stickem-container', stickClass: 'stickit', endStickClass: 'stickit-end' -}); \ No newline at end of file +});