mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
[ember] refactor @ember/polyfills types into their own package (#28797)
* [ember] refactor @ember/polyfills into its own module fixes https://github.com/typed-ember/ember-cli-typescript/issues/273 * [ember] delay activation of some tests until after future improvements to Ember.assign/merge
This commit is contained in:
committed by
Ryan Cavanaugh
parent
92abd0cd3d
commit
0c694b22fb
@@ -0,0 +1,25 @@
|
||||
import { assign, merge } from '@ember/polyfills';
|
||||
|
||||
(() => { /* assign */
|
||||
assign({}, { a: 'b'});
|
||||
assign({}, { a: 'b'}).a; // $ExpectType string
|
||||
assign({ a: 6 }, { a: 'b'}).a; // $ExpectType string
|
||||
assign({ a: 6 }, {}).a; // $ExpectType number
|
||||
assign({ b: 6 }, {}).a; // $ExpectError
|
||||
// TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291
|
||||
// assign({}, { b: 6 }, {}).b; // $ExpectType number
|
||||
assign({ a: 'hello' }, { b: 6 }, {}).a; // $ExpectType string
|
||||
// TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291
|
||||
// assign({ a: 'hello' }, { b: 6 }, { a: true }).a; // $ExpectType boolean
|
||||
// TODO enable after https://github.com/typed-ember/ember-cli-typescript/issues/291
|
||||
// assign({ a: 'hello' }, '', { a: true }).a; // $ExpectError
|
||||
assign({ d: ['gobias industries'] }, { a: 'hello' }, { b: 6 }, { a: true }).d; // $ExpectType string[]
|
||||
})();
|
||||
|
||||
(() => { /* merge */
|
||||
merge({}, { a: 'b'});
|
||||
merge({}, { a: 'b'}).a; // $ExpectType string
|
||||
merge({ a: 6 }, { a: 'b'}).a; // $ExpectType string
|
||||
merge({ a: 6 }, {}).a; // $ExpectType number
|
||||
merge({ b: 6 }, {}).a; // $ExpectError
|
||||
})();
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// Type definitions for @ember/polyfills 3.0
|
||||
// Project: http://emberjs.com/
|
||||
// Definitions by: Mike North <https://github.com/mike-north>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export const assign: typeof Ember.assign;
|
||||
export const merge: typeof Ember.merge;
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"@ember/polyfills": ["ember__polyfills"]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ember__polyfills-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {}
|
||||
}
|
||||
Reference in New Issue
Block a user