mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Fix ban-type lint
This commit is contained in:
committed by
Olivier Sechet
parent
5b409b39e8
commit
c1295d24ee
Vendored
+10
-7
@@ -11,7 +11,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Definitions partially generated using tsd-jsdoc (https://github.com/englercj/tsd-jsdoc)
|
||||
|
||||
declare type GlobalObject = Object;
|
||||
interface GlobalObject { [key: string]: any; }
|
||||
|
||||
/**
|
||||
* @namespace ol
|
||||
@@ -1491,6 +1491,9 @@ declare module ol {
|
||||
}
|
||||
}
|
||||
|
||||
/* From ol/typedefs.js */
|
||||
type EventsListenerFunctionType = ((evt: ol.events.Event) => void) | ((evt: ol.events.Event) => boolean);
|
||||
|
||||
/**
|
||||
* @namespace ol.extent
|
||||
*/
|
||||
@@ -7957,7 +7960,7 @@ declare module ol {
|
||||
* will be an array of keys.
|
||||
* @api stable
|
||||
*/
|
||||
on(type: (string | string[]), listener: Function, opt_this?: GlobalObject): (ol.EventsKey | ol.EventsKey[]);
|
||||
on(type: (string | string[]), listener: ol.EventsListenerFunctionType, opt_this?: GlobalObject): (ol.EventsKey | ol.EventsKey[]);
|
||||
|
||||
/**
|
||||
* Listen once for a certain type of event.
|
||||
@@ -7969,7 +7972,7 @@ declare module ol {
|
||||
* will be an array of keys.
|
||||
* @api stable
|
||||
*/
|
||||
once(type: (string | string[]), listener: Function, opt_this?: GlobalObject): (ol.EventsKey | ol.EventsKey[]);
|
||||
once(type: (string | string[]), listener: ol.EventsListenerFunctionType, opt_this?: GlobalObject): (ol.EventsKey | ol.EventsKey[]);
|
||||
|
||||
/**
|
||||
* Unlisten for a certain type of event.
|
||||
@@ -7979,7 +7982,7 @@ declare module ol {
|
||||
* `listener`.
|
||||
* @api stable
|
||||
*/
|
||||
un(type: (string | string[]), listener: Function, opt_this?: GlobalObject): void;
|
||||
un(type: (string | string[]), listener: ol.EventsListenerFunctionType, opt_this?: GlobalObject): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -11694,7 +11697,7 @@ declare module ol {
|
||||
* target: (EventTarget|ol.events.EventTarget),
|
||||
* type: string}}
|
||||
*/
|
||||
type EventsKey = Object;
|
||||
type EventsKey = GlobalObject;
|
||||
|
||||
/**
|
||||
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
||||
@@ -11995,7 +11998,7 @@ declare module ol {
|
||||
* @typedef {{numberOfFeatures: number,
|
||||
* bounds: ol.Extent}}
|
||||
*/
|
||||
type WFSFeatureCollectionMetadata = Object;
|
||||
type WFSFeatureCollectionMetadata = GlobalObject;
|
||||
|
||||
/**
|
||||
* Total deleted; total inserted; total updated; array of insert ids.
|
||||
@@ -12004,7 +12007,7 @@ declare module ol {
|
||||
* totalUpdated: number,
|
||||
* insertIds: Array.<string>}}
|
||||
*/
|
||||
type WFSTransactionResponse = Object;
|
||||
type WFSTransactionResponse = GlobalObject;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
|
||||
@@ -6,8 +6,9 @@ let stringValue: string;
|
||||
let stringArray: string[];
|
||||
let jsonValue: JSON;
|
||||
let domEventTarget: EventTarget;
|
||||
let fn: Function;
|
||||
let object: Object;
|
||||
let listener: ol.EventsListenerFunctionType;
|
||||
let object: { [key: string]: any };
|
||||
let fn: () => void;
|
||||
|
||||
// Callback predefinitions for OpenLayers
|
||||
let preRenderFunction: ol.PreRenderFunction;
|
||||
@@ -579,12 +580,12 @@ observable.dispatchEvent({ type: stringValue, a: numberValue, b: stringValue, c:
|
||||
observable.dispatchEvent(olEvent);
|
||||
observable.dispatchEvent(stringValue);
|
||||
numberValue = observable.getRevision();
|
||||
eventKeyMixed = observable.on(stringValue, fn);
|
||||
eventKeyMixed = observable.on([stringValue, stringValue], fn, {});
|
||||
eventKeyMixed = observable.once(stringValue, fn);
|
||||
eventKeyMixed = observable.once([stringValue, stringValue], fn, {});
|
||||
observable.un(stringValue, fn);
|
||||
observable.un([stringValue, stringValue], fn, {});
|
||||
eventKeyMixed = observable.on(stringValue, listener);
|
||||
eventKeyMixed = observable.on([stringValue, stringValue], listener, {});
|
||||
eventKeyMixed = observable.once(stringValue, listener);
|
||||
eventKeyMixed = observable.once([stringValue, stringValue], listener, {});
|
||||
observable.un(stringValue, listener);
|
||||
observable.un([stringValue, stringValue], listener, {});
|
||||
|
||||
//
|
||||
// ol.proj
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// It appears somewhat difficult to remove the Function and Object types
|
||||
"ban-types": false,
|
||||
// This currently fails for an option that does not appear to be in OL 4
|
||||
"no-any-union": false,
|
||||
// Not sure how to work around this, or if it's necessary to
|
||||
|
||||
Reference in New Issue
Block a user